diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-09 18:21:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-09 18:21:46 +0000 |
commit | af064aeee607b8a69ce5b9d50482431b753b16e1 (patch) | |
tree | e17beb4aaa59aac18b9e95ed8ffcd7b8d792006f /test/Transforms/GVN | |
parent | b2c6ae8c0b4f27b97ee3c546554c257331512066 (diff) | |
download | external_llvm-af064aeee607b8a69ce5b9d50482431b753b16e1.zip external_llvm-af064aeee607b8a69ce5b9d50482431b753b16e1.tar.gz external_llvm-af064aeee607b8a69ce5b9d50482431b753b16e1.tar.bz2 |
fix hte last remaining known (by me) phi translation bug. When we reanalyze
clobbers to forward pieces of large stores to small loads, we need to consider
the properly phi translated pointer in the store block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN')
-rw-r--r-- | test/Transforms/GVN/rle.ll | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index 46fc818..d419fd2 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -469,6 +469,9 @@ exit: define i8 @phi_trans4(i8* %p) { ; CHECK: @phi_trans4 entry: + %X3 = getelementptr i8* %p, i32 192 + store i8 192, i8* %X3 + %X = getelementptr i8* %p, i32 4 %Y = load i8* %X br label %loop @@ -476,11 +479,15 @@ entry: loop: %i = phi i32 [4, %entry], [192, %loop] %X2 = getelementptr i8* %p, i32 %i - %Y2 = load i8* %X + %Y2 = load i8* %X2 + +; CHECK: loop: +; CHECK-NEXT: %Y2 = phi i8 [ %Y, %entry ], [ 0, %loop ] +; CHECK-NOT: load i8 %cond = call i1 @cond2() - %Z = bitcast i8 *%X2 to i32* + %Z = bitcast i8 *%X3 to i32* store i32 0, i32* %Z br i1 %cond, label %loop, label %out @@ -492,6 +499,7 @@ out: define i8 @phi_trans5(i8* %p) { ; CHECK: @phi_trans5 entry: + %X4 = getelementptr i8* %p, i32 2 store i8 19, i8* %X4 @@ -502,8 +510,7 @@ entry: loop: %i = phi i32 [4, %entry], [3, %cont] %X2 = getelementptr i8* %p, i32 %i - %Y2 = load i8* %X2 - ;; FIXME: This load is being incorrectly replaced! + %Y2 = load i8* %X2 ; Ensure this load is not being incorrectly replaced. %cond = call i1 @cond2() br i1 %cond, label %cont, label %out @@ -511,6 +518,11 @@ cont: %Z = getelementptr i8* %X2, i32 -1 %Z2 = bitcast i8 *%Z to i32* store i32 50462976, i32* %Z2 ;; (1 << 8) | (2 << 16) | (3 << 24) + + +; CHECK: store i32 +; CHECK-NEXT: getelementptr i8* %p, i32 3 +; CHECK-NEXT: load i8* br label %loop out: |