diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-28 06:49:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-28 06:49:44 +0000 |
commit | 3ddfb21306831c96791505c2e8e727923010354f (patch) | |
tree | 3f48d7c7603349fdccf1da0bf2285df424ba6b97 /test/Transforms/InstCombine/select.ll | |
parent | 0e6b590b91fcf6d49d2c25196f5053ce285e17f5 (diff) | |
download | llvm-3ddfb21306831c96791505c2e8e727923010354f.tar.gz llvm-3ddfb21306831c96791505c2e8e727923010354f.tar.bz2 llvm-3ddfb21306831c96791505c2e8e727923010354f.tar.xz |
The select instruction is not neccesarily in the same block as the
phi nodes. Make sure to phi translate from the right block.
This fixes a llvm-building-llvm failure on GVN-PRE.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/select.ll')
-rw-r--r-- | test/Transforms/InstCombine/select.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll index 701d5967a6..b04382e8b1 100644 --- a/test/Transforms/InstCombine/select.ll +++ b/test/Transforms/InstCombine/select.ll @@ -247,3 +247,19 @@ ret: %b = select i1 %a, i32 %A, i32 %c ret i32 %b } + +define i32 @test29(i1 %cond, i32 %A, i32 %B) { +entry: + br i1 %cond, label %jump, label %ret +jump: + br label %ret +ret: + %c = phi i32 [%A, %jump], [%B, %entry] + %a = phi i1 [true, %jump], [false, %entry] + br label %next + +next: + %b = select i1 %a, i32 %A, i32 %c + ret i32 %b +} + |