diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-02-17 22:21:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-02-17 22:21:26 +0000 |
| commit | abb8eb2c63c4e272c4bad4490df8c32a69e7812f (patch) | |
| tree | cc85ac918e0cf1c9f3fdc863ea7a1748356b994d /llvm/test | |
| parent | fb59c7c7d878cbbcb9351316abf840b70e38c07a (diff) | |
| download | bcm5719-llvm-abb8eb2c63c4e272c4bad4490df8c32a69e7812f.tar.gz bcm5719-llvm-abb8eb2c63c4e272c4bad4490df8c32a69e7812f.zip | |
fix instcombine merging GEPs through a PHI to only make the
result inbounds if all of the inputs are inbounds.
llvm-svn: 125785
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/phi.ll | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/phi.ll b/llvm/test/Transforms/InstCombine/phi.ll index ad71ba68331..e93666fbf8b 100644 --- a/llvm/test/Transforms/InstCombine/phi.ll +++ b/llvm/test/Transforms/InstCombine/phi.ll @@ -125,7 +125,7 @@ Exit: ; preds = %Loop define i32* @test8({ i32, i32 } *%A, i1 %b) { BB0: - %X = getelementptr { i32, i32 } *%A, i32 0, i32 1 + %X = getelementptr inbounds { i32, i32 } *%A, i32 0, i32 1 br i1 %b, label %BB1, label %BB2 BB1: @@ -139,7 +139,7 @@ BB2: ; CHECK: @test8 ; CHECK-NOT: phi ; CHECK: BB2: -; CHECK-NEXT: %B = getelementptr +; CHECK-NEXT: %B = getelementptr %0 ; CHECK-NEXT: ret i32* %B } @@ -525,3 +525,4 @@ Exit: ; preds = %Loop ; CHECK: Exit: ; CHECK-NEXT: ret i32 %B } + |

