diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:10:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:10:11 +0000 |
commit | 213a8d3a481e0166d0397b09f0d7694cafee5af1 (patch) | |
tree | a3ebfce67d8fbb89e7bb18a5070383bc88fd1a8f /test/Transforms | |
parent | a664bb7bdcc074cb03a2fa6ed1c52a2ca9453550 (diff) | |
download | external_llvm-213a8d3a481e0166d0397b09f0d7694cafee5af1.zip external_llvm-213a8d3a481e0166d0397b09f0d7694cafee5af1.tar.gz external_llvm-213a8d3a481e0166d0397b09f0d7694cafee5af1.tar.bz2 |
merge phi-merge.ll into phi.ll
I don't know what Dan wants to do with phi-merge-gep.ll, I'll let
him deal with it because instcombine may end up sinking these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/phi-merge.ll | 31 | ||||
-rw-r--r-- | test/Transforms/InstCombine/phi.ll | 33 |
2 files changed, 33 insertions, 31 deletions
diff --git a/test/Transforms/InstCombine/phi-merge.ll b/test/Transforms/InstCombine/phi-merge.ll deleted file mode 100644 index c41f503..0000000 --- a/test/Transforms/InstCombine/phi-merge.ll +++ /dev/null @@ -1,31 +0,0 @@ -; RUN: opt < %s -instcombine -S | not grep {phi i32} -; PR1777 - -declare i1 @rrr() - -define i1 @zxcv() { -entry: -%a = alloca i32 -%i = ptrtoint i32* %a to i32 -%b = call i1 @rrr() -br i1 %b, label %one, label %two - -one: -%x = phi i32 [%i, %entry], [%y, %two] -%c = call i1 @rrr() -br i1 %c, label %two, label %end - -two: -%y = phi i32 [%i, %entry], [%x, %one] -%d = call i1 @rrr() -br i1 %d, label %one, label %end - -end: -%f = phi i32 [ %x, %one], [%y, %two] -; Change the %f to %i, and the optimizer suddenly becomes a lot smarter -; even though %f must equal %i at this point -%g = inttoptr i32 %f to i32* -store i32 10, i32* %g -%z = call i1 @rrr() -ret i1 %z -} diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index d5665f6..b73ce3f 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -186,6 +186,39 @@ bb2: ; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] ; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 16 ; CHECK-NEXT: ret i32 %E +} + +; PR1777 +declare i1 @test11a() + +define i1 @test11() { +entry: + %a = alloca i32 + %i = ptrtoint i32* %a to i32 + %b = call i1 @test11a() + br i1 %b, label %one, label %two + +one: + %x = phi i32 [%i, %entry], [%y, %two] + %c = call i1 @test11a() + br i1 %c, label %two, label %end + +two: + %y = phi i32 [%i, %entry], [%x, %one] + %d = call i1 @test11a() + br i1 %d, label %one, label %end + +end: + %f = phi i32 [ %x, %one], [%y, %two] + ; Change the %f to %i, and the optimizer suddenly becomes a lot smarter + ; even though %f must equal %i at this point + %g = inttoptr i32 %f to i32* + store i32 10, i32* %g + %z = call i1 @test11a() + ret i1 %z +; CHECK: @test11 +; CHECK-NOT: phi i32 +; CHECK: ret i1 %z } |