summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-13 02:20:29 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-13 02:20:29 +0000
commit0af20d847ac89f797d613a8a4fc3e7127ccb0b36 (patch)
tree2a4654a1e0e71bac4b84f8ee2ad0bcae6ac150e8 /test/Transforms/InstCombine
parentbc733f54c0d344d72aadf2f925a08babfeb7ea6a (diff)
downloadllvm-0af20d847ac89f797d613a8a4fc3e7127ccb0b36.tar.gz
llvm-0af20d847ac89f797d613a8a4fc3e7127ccb0b36.tar.bz2
llvm-0af20d847ac89f797d613a8a4fc3e7127ccb0b36.tar.xz
Fix a typo in ValueTracking that's causing instcombine to delete needed shift instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/shift-sra.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/shift-sra.ll b/test/Transforms/InstCombine/shift-sra.ll
index 58f322635c..a578bbe4d4 100644
--- a/test/Transforms/InstCombine/shift-sra.ll
+++ b/test/Transforms/InstCombine/shift-sra.ll
@@ -56,3 +56,23 @@ C:
; CHECK: %P = phi i64
; CHECK-NEXT: ret i64 %P
}
+
+; rdar://7732987
+define i32 @test5(i32 %Y) {
+ br i1 undef, label %A, label %C
+A:
+ br i1 undef, label %B, label %D
+B:
+ br label %D
+C:
+ br i1 undef, label %D, label %E
+D:
+ %P = phi i32 [0, %A], [0, %B], [%Y, %C]
+ %S = ashr i32 %P, 16
+ ret i32 %S
+; CHECK: @test5
+; CHECK: %P = phi i32
+; CHECK-NEXT: ashr i32 %P, 16
+E:
+ ret i32 0
+}