aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-18 04:00:49 +0000
committerChris Lattner <sabre@nondot.org>2008-06-18 04:00:49 +0000
commit4200c2066782bdd2c6def18cffeaad48210bf05a (patch)
tree5fa23cda7a9fc5a7b5c5aa8de0db1efef2075866 /test
parent651e1440ecdc0ae3e04c44b48aad501c5109563a (diff)
downloadexternal_llvm-4200c2066782bdd2c6def18cffeaad48210bf05a.zip
external_llvm-4200c2066782bdd2c6def18cffeaad48210bf05a.tar.gz
external_llvm-4200c2066782bdd2c6def18cffeaad48210bf05a.tar.bz2
make truncate/sext elimination capable of changing phi's. This
implements rdar://6013816 and the testcase in Transforms/InstCombine/sext-misc.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/sext-misc.ll17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/Transforms/InstCombine/sext-misc.ll b/test/Transforms/InstCombine/sext-misc.ll
index 076f595..6985002 100644
--- a/test/Transforms/InstCombine/sext-misc.ll
+++ b/test/Transforms/InstCombine/sext-misc.ll
@@ -1,6 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sext
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep movslq
-; RUN: llvm-as < %s | llc -march=x86 | not grep sar
declare i32 @llvm.ctpop.i32(i32)
declare i32 @llvm.ctlz.i32(i32)
@@ -50,3 +48,18 @@ define i32 @woo(i8 %a, i32 %f, i1 %p, i32* %z) {
%n = sext i16 %s to i32
ret i32 %n
}
+
+; rdar://6013816
+define i16 @test(i16 %t, i1 %cond) nounwind {
+entry:
+ br i1 %cond, label %T, label %F
+T:
+ %t2 = sext i16 %t to i32
+ br label %F
+
+F:
+ %V = phi i32 [%t2, %T], [42, %entry]
+ %W = trunc i32 %V to i16
+ ret i16 %W
+}
+