diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-07-04 22:05:26 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-07-04 22:05:26 +0000 |
commit | 76735fbd2e4e145e11a2fa8eebed4039556d5a43 (patch) | |
tree | 9a116f157c538130dcf099f0c36e7154af74c9b3 /test/Transforms/InstCombine/pr20079.ll | |
parent | 483d89bcd454011f1ceb3aab7424463ea85a4f23 (diff) |
IR: Fold away compares between GV GEPs and GVs
A GEP of a non-weak global variable will not be equivalent to another
non-weak global variable or a GEP of such a variable.
Differential Revision: http://reviews.llvm.org/D4238
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/pr20079.ll')
-rw-r--r-- | test/Transforms/InstCombine/pr20079.ll | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/test/Transforms/InstCombine/pr20079.ll b/test/Transforms/InstCombine/pr20079.ll index 3c86ecc5f30..ce9c4deb06a 100644 --- a/test/Transforms/InstCombine/pr20079.ll +++ b/test/Transforms/InstCombine/pr20079.ll @@ -3,11 +3,7 @@ @c = internal global i32 0, align 4 ; CHECK-LABEL: @fn1 -; CHECK: [[ADD:%.*]] = add i32 %a, -1 -; CHECK-NEXT: [[AND:%.*]] = and i32 [[ADD]], sub (i32 0, i32 zext (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @b, i64 0, i64 0), i32* @c) to i32)) -; CHECK-NEXT: ret i32 [[AND]] +; CHECK-NEXT: ret i32 0 define i32 @fn1(i32 %a) { - %xor = add i32 %a, -1 - %mul = mul nsw i32 %xor, zext (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @b, i64 0, i64 0), i32* @c) to i32) - ret i32 %mul + ret i32 0 } |