diff options
author | Duncan Sands <baldrick@free.fr> | 2010-11-15 17:52:45 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-11-15 17:52:45 +0000 |
commit | 552008946530e01efdad15044e1f621883d14a3a (patch) | |
tree | f03a042355f51a15a352a2872e313f399573f336 /test/Transforms/InstCombine/phi.ll | |
parent | 503dcc982227893c532f03cbd6449e01a1739df3 (diff) | |
download | llvm-552008946530e01efdad15044e1f621883d14a3a.tar.gz llvm-552008946530e01efdad15044e1f621883d14a3a.tar.bz2 llvm-552008946530e01efdad15044e1f621883d14a3a.tar.xz |
Teach InstructionSimplify the trick of skipping incoming phi
values that are equal to the phi itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/phi.ll')
-rw-r--r-- | test/Transforms/InstCombine/phi.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index 1181aefdb3..c3e034fb5c 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -469,3 +469,22 @@ ret: ; CHECK: @test20 ; CHECK: ret i1 false } + +define i1 @test21(i1 %c1, i1 %c2) { + %a = alloca i32 + %b = alloca i32 + %c = alloca i32 + br i1 %c1, label %true, label %false +true: + br label %loop +false: + br label %loop +loop: + %p = phi i32* [ %a, %true ], [ %b, %false ], [ %p, %loop ] + %r = icmp eq i32* %p, %c + br i1 %c2, label %ret, label %loop +ret: + ret i1 %r +; CHECK: @test21 +; CHECK: ret i1 false +} |