summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/cc1as_main.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-07-10 15:12:31 +0000
committerSanjay Patel <spatel@rotateright.com>2018-07-10 15:12:31 +0000
commit509a1e7a9b444bccc88b57685a0e664f61c37f0e (patch)
treeb7c00d106ebc4c670f95ff9edc987ee8e4feab3b /clang/tools/driver/cc1as_main.cpp
parentac7d10bb0854c8df3ddff0d73c3c6be401150f93 (diff)
downloadbcm5719-llvm-509a1e7a9b444bccc88b57685a0e664f61c37f0e.tar.gz
bcm5719-llvm-509a1e7a9b444bccc88b57685a0e664f61c37f0e.zip
[InstCombine] safely allow non-commutative binop identity constant folds
This was originally intended with D48893, but as discussed there, we have to make the folds safe from producing extra poison. This should give the single binop folds the same capabilities as the existing folds for 2-binops+shuffle. LLVM binary opcode review: there are a total of 18 binops. There are 7 commutative binops (add, mul, and, or, xor, fadd, fmul) which we already fold. We're able to fold 6 more opcodes with this patch (shl, lshr, ashr, fdiv, udiv, sdiv). There are no folds for srem/urem/frem AFAIK. We don't bother with sub/fsub with constant operand 1 because those are canonicalized to add/fadd. 7 + 6 + 3 + 2 = 18. llvm-svn: 336684
Diffstat (limited to 'clang/tools/driver/cc1as_main.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud