summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/select.ll
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-01-28 03:28:10 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-01-28 03:28:10 +0000
commitdf3bfae1515c826804754616b989b18630fc4d93 (patch)
tree76656409f00a66862e87a7597f2841da00825355 /test/Transforms/InstCombine/select.ll
parent1ffb5336999b327384752b0f60ad0c4cb4cb8946 (diff)
downloadllvm-df3bfae1515c826804754616b989b18630fc4d93.tar.gz
llvm-df3bfae1515c826804754616b989b18630fc4d93.tar.bz2
llvm-df3bfae1515c826804754616b989b18630fc4d93.tar.xz
Fold select + select where both selects are on the same condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/select.ll')
-rw-r--r--test/Transforms/InstCombine/select.ll17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll
index 54cfc467cc..b66b22cff6 100644
--- a/test/Transforms/InstCombine/select.ll
+++ b/test/Transforms/InstCombine/select.ll
@@ -692,7 +692,7 @@ define i64 @test50(i32 %a) nounwind {
; PR8994
-; Theis select instruction can't be eliminated because trying to do so would
+; This select instruction can't be eliminated because trying to do so would
; change the number of vector elements. This used to assert.
define i48 @test51(<3 x i1> %icmp, <3 x i16> %tmp) {
%select = select <3 x i1> %icmp, <3 x i16> zeroinitializer, <3 x i16> %tmp
@@ -700,3 +700,18 @@ define i48 @test51(<3 x i1> %icmp, <3 x i16> %tmp) {
%tmp2 = bitcast <3 x i16> %select to i48
ret i48 %tmp2
}
+
+; PR8575
+
+@g = common global i32 0, align 4
+define void @test52(i32 %n, i32 %m) nounwind {
+entry:
+ %cmp = icmp sgt i32 %n, %m
+ %. = select i1 %cmp, i32 1, i32 3
+ %add = add nsw i32 %., 3
+ %storemerge = select i1 %cmp, i32 %., i32 %add
+; CHECK: select i1 %cmp, i32 1, i32 6
+ store i32 %storemerge, i32* @g, align 4
+ ret void
+}
+