InstCombine: Add a combine that turns (2^n)-1 ^ x back into (2^n)-1 - x iff x is...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 24 Dec 2011 17:31:53 +0000 (17:31 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 24 Dec 2011 17:31:53 +0000 (17:31 +0000)
commit49064ff7708bcd3b720ce79bc7629c2f3207b8d6
treedaadbed9a12eeceed7aa130309f423a14dadc44a
parent009da05e750b7bac7e1902fcdc85394de4ea63b3
InstCombine: Add a combine that turns (2^n)-1 ^ x back into (2^n)-1 - x iff x is smaller than 2^n and it fuses with a following add.

This was intended to undo the sub canonicalization in cases where it's not profitable, but it also
finds some cases on it's own.

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