diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:07:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:07:07 +0000 |
commit | a664bb7bdcc074cb03a2fa6ed1c52a2ca9453550 (patch) | |
tree | 4326efaab57032efbbc2fe022c1e7407c1a816e5 /test/Transforms/InstCombine/phi.ll | |
parent | 751a362c22ed5e08aafbc8f243f7aac3203189f8 (diff) | |
download | external_llvm-a664bb7bdcc074cb03a2fa6ed1c52a2ca9453550.zip external_llvm-a664bb7bdcc074cb03a2fa6ed1c52a2ca9453550.tar.gz external_llvm-a664bb7bdcc074cb03a2fa6ed1c52a2ca9453550.tar.bz2 |
when merging two loads, make sure to take the min of their alignment,
not the max. This didn't matter until the previous patch because
instcombine would refuse to sink loads with differenting alignments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/phi.ll')
-rw-r--r-- | test/Transforms/InstCombine/phi.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index 08d28b4..d5665f6 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -157,9 +157,35 @@ bb1: bb2: %E = phi i32 [ %C, %bb ], [ %D, %bb1 ] ret i32 %E +; CHECK: @test9 ; CHECK: bb2: ; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] ; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 1 ; CHECK-NEXT: ret i32 %E } + +define i32 @test10(i32* %A, i32* %B) { +entry: + %c = icmp eq i32* %A, null + br i1 %c, label %bb1, label %bb + +bb: + %C = load i32* %B, align 16 + br label %bb2 + +bb1: + %D = load i32* %A, align 32 + br label %bb2 + +bb2: + %E = phi i32 [ %C, %bb ], [ %D, %bb1 ] + ret i32 %E +; CHECK: @test10 +; CHECK: bb2: +; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] +; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 16 +; CHECK-NEXT: ret i32 %E + +} + |