]> granicus.if.org Git - llvm/commit
[InstCombine] try to fold 'sub' to 'not'
authorSanjay Patel <spatel@rotateright.com>
Sat, 28 Jul 2018 16:48:44 +0000 (16:48 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 28 Jul 2018 16:48:44 +0000 (16:48 +0000)
commitbd68890e8f03cfcd67c076946b95cbcfc862e041
tree165e3ea659f5f94ea8931f97b1ba30fd74e6ee31
parent234c23e0a025de2ee741242b19da521e7bfff715
[InstCombine] try to fold 'sub' to 'not'

https://rise4fun.com/Alive/jDd

Patterns with add/sub combos can be improved using
'not' ops. This is better for analysis and may lead
to follow-on transforms because 'xor' and 'add' are
commutative/associative. It can also help codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338200 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/sub-not.ll