[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-12-17 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. tstellar marked an inline comment as done. Closed by commit rG3203143f1356: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int) (authored by tstellar). Herald added a subscriber: pengfei. Repository:

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-29 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84405/new/ https://reviews.llvm.org/D84405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar marked an inline comment as done. tstellar added inline comments. Comment at: clang/test/CodeGen/builtins-overflow.c:123 + // CHECK: br i1 [[C2]] + int r; + if (__builtin_mul_overflow(x, y, &r)) vsk wrote: > vsk wrote: > > Could you add a test for the

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 281419. tstellar added a comment. Add volatile test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84405/new/ https://reviews.llvm.org/D84405 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/test/CodeGen/buil

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-28 Thread Vedant Kumar via Phabricator via cfe-commits
vsk accepted this revision. vsk added a comment. This revision is now accepted and ready to land. Thanks, looks good to me with a small test addition. Comment at: clang/test/CodeGen/builtins-overflow.c:123 + // CHECK: br i1 [[C2]] + int r; + if (__builtin_mul_overflow(x, y,

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. Here is the assembly comparison for the 64-bit test I added between gcc and clang trunk + patch: https://reviews.llvm.org/P8227 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84405/new/ https://reviews.llvm.org/D84405 _

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. This is the test driver I used for testing. I compared the clang 11 + this patch with gcc 10 and saw no differences: https://gist.github.com/tstellar/80dae2ab8a18d810b10b8e42777f4fe4 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 281092. tstellar added a comment. Herald added a subscriber: mstorsjo. Add 64-bit test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84405/new/ https://reviews.llvm.org/D84405 Files: clang/lib/CodeGen/CGBu

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. In D84405#2170110 , @vsk wrote: > How were you able to show that the specialized IRGen is equivalent to the > generic kind? I tried doing this with direct inspection > (https://godbolt.org/z/o5WEn3), but wasn't able to convince

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added a comment. How were you able to show that the specialized IRGen is equivalent to the generic kind? I tried doing this with direct inspection (https://godbolt.org/z/o5WEn3), but wasn't able to convince myself. In the past I used a test driver to compare the before/after compiler output

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 280104. tstellar added a comment. Remove stray comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84405/new/ https://reviews.llvm.org/D84405 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/test/CodeGen/b

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision. tstellar added reviewers: vsk, efriedma. Herald added a project: clang. Add a special case for handling __builtin_mul_overflow with unsigned inputs and a signed output to avoid emitting the __muloti4 library call on x86_64. __muloti4 is not implemented in libgcc, s