InstCombine: Try harder to combine icmp instructions
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 30 Aug 2014 06:18:20 +0000 (06:18 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 30 Aug 2014 06:18:20 +0000 (06:18 +0000)
commitc6219bad2e6df66a8eb7aca8edcc56bc47101f39
tree64b8da30bb1eb104ab01003a5d215a7f7038e922
parentbcbae3d68099b2f3031168fa1528fe11ce0916cf
InstCombine: Try harder to combine icmp instructions

consider: (and (icmp X, Y), (and Z, (icmp A, B)))
It may be possible to combine (icmp X, Y) with (icmp A, B).
If we successfully combine, create an 'and' instruction with Z.

This fixes PR20814.

N.B. There is room for improvement after this change but I'm not
convinced it's worth chasing yet.

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