diff options
author | Pawel Wodnicki <pawel@32bitmicro.com> | 2012-11-21 19:01:53 +0000 |
---|---|---|
committer | Pawel Wodnicki <pawel@32bitmicro.com> | 2012-11-21 19:01:53 +0000 |
commit | 07d7748544abaaf97123233804a194478ed020b3 (patch) | |
tree | 03f936edbb07aad478f391f460fe3602da8044e4 /test | |
parent | b30ce3e484f1e7f37a709e6fa7a91712a3d85e97 (diff) | |
download | llvm-07d7748544abaaf97123233804a194478ed020b3.tar.gz llvm-07d7748544abaaf97123233804a194478ed020b3.tar.bz2 llvm-07d7748544abaaf97123233804a194478ed020b3.tar.xz |
Merging r168181: into 3.2 release branch.
Fix PR14361: wrong simplification of A+B==B+A. You may think that the old logic
replaced by this patch is equivalent to the new logic, but you'd be wrong, and
that's exactly where the bug was. There's a similar bug in instsimplify which
manifests itself as instsimplify failing to simplify this, rather than doing it
wrong, see next commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index eaff87d695..8e064a4f2f 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -659,3 +659,21 @@ define i1 @test64(i8 %a, i32 %b) nounwind { ; CHECK-NEXT: %c = icmp eq i8 %1, %a ; CHECK-NEXT: ret i1 %c } + +define i1 @test65(i64 %A, i64 %B) { + %s1 = add i64 %A, %B + %s2 = add i64 %A, %B + %cmp = icmp eq i64 %s1, %s2 +; CHECK: @test65 +; CHECK-NEXT: ret i1 true + ret i1 %cmp +} + +define i1 @test66(i64 %A, i64 %B) { + %s1 = add i64 %A, %B + %s2 = add i64 %B, %A + %cmp = icmp eq i64 %s1, %s2 +; CHECK: @test66 +; CHECK-NEXT: ret i1 true + ret i1 %cmp +} |