InstCombine: Fold X-C1 <u 2 -> (X & -2) == C1
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Jul 2013 11:53:08 +0000 (11:53 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Jul 2013 11:53:08 +0000 (11:53 +0000)
commit53fc39992df9c485ea45f28998c1ef99caed63f9
tree1b423f8882c8064494312f2df66b31ba3dcf8c8b
parent4010110ccf21be0517034b6ccf9493628afaad77
InstCombine: Fold X-C1 <u 2 -> (X & -2) == C1

Back in r179493 we determined that two transforms collided with each
other.  The fix back then was to reorder the transforms so that the
preferred transform would give it a try and then we would try the
secondary transform.  However, it was noted that the best approach would
canonicalize one transform into the other, removing the collision and
allowing us to optimize IR given to us in that form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185808 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/icmp.ll