[InstCombine] Simplify the logic from r219067 using ValueTracking
authorHal Finkel <hfinkel@anl.gov>
Sun, 5 Oct 2014 00:53:02 +0000 (00:53 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 5 Oct 2014 00:53:02 +0000 (00:53 +0000)
commitbda7a45f8eaa68d994519e85c30844f27702ec26
tree7e1aae5a62615a2288198bdc0f0212d900649756
parent3cdf75c5cf1eb16dbac52b33c4aa944218ca66ab
[InstCombine] Simplify the logic from r219067 using ValueTracking

Joerg suggested on IRC that I look at generalizing the logic from r219067 to
handle more general redundancies (like removing an assume(x > 3) dominated by
an assume(x > 5)). The way to do this would be to ask ValueTracking to
determine the value of the i1 argument. It turns out that ValueTracking is not
very good at this right now (although it does get the trivial redundancy case)
because it does not understand ICmps. Nevertheless, the resulting code in
InstCombine is simpler than r219067, so we might as well do it now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219070 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp