[ValueTracking] Look through casts when both operands are casts.
authorJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 17:25:25 +0000 (17:25 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 17:25:25 +0000 (17:25 +0000)
commit983cfca15dab3fb1731fb3c970f9d058173d8ef3
tree0cf783352d6073bb5f78d1d1a498ae89063ac864
parenta1bc1c274da23263d1185ec2352d15faf65bba2e
[ValueTracking] Look through casts when both operands are casts.

We only looked through casts when one operand was a constant. We can also look through casts when both operands are non-constant, but both are in fact the same cast type. For example:

%1 = icmp ult i8 %a, %b
%2 = zext i8 %a to i32
%3 = zext i8 %b to i32
%4 = select i1 %1, i32 %2, i32 %3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246678 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
unittests/Analysis/ValueTrackingTest.cpp