InstCombine: FoldOrOfICmps harder
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 28 Nov 2014 19:58:29 +0000 (19:58 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 28 Nov 2014 19:58:29 +0000 (19:58 +0000)
commita1129621ddd7d37aae23372d007fc543c72f21cd
treed42fe12da64ad39575693359fd57421e8fb75c68
parent69ed1ff9b3235a864bcdfec3da798edfabd702a7
InstCombine: FoldOrOfICmps harder

We may be in a situation where the icmps might not be near each other in
a tree of or instructions.  Try to dig out related compare instructions
and see if they combine.

N.B.  This won't fire on deep trees of compares because rewritting the
tree might end up creating a net increase of IR.  We may have to resort
to something more sophisticated if this is a real problem.

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