summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/zext-trunc.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-02-10 02:17:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-02-10 02:17:34 +0000
commit046632f272b22a653c204c0ef56eb4076368d4bb (patch)
tree3a5a7bc876be00a2593850f5fced7031fa9643d4 /test/CodeGen/X86/zext-trunc.ll
parent37145b6e4ce1984b54d7fb79116d57e203437136 (diff)
downloadllvm-046632f272b22a653c204c0ef56eb4076368d4bb.tar.gz
llvm-046632f272b22a653c204c0ef56eb4076368d4bb.tar.bz2
llvm-046632f272b22a653c204c0ef56eb4076368d4bb.tar.xz
Now that ShrinkDemandedOps() is separated out from DAG combine. It sometimes leave some obvious nops which dag combine used to clean up afterwards e.g. (trunk (ext n)) -> n. Look for them and squash them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/zext-trunc.ll')
-rw-r--r--test/CodeGen/X86/zext-trunc.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/X86/zext-trunc.ll b/test/CodeGen/X86/zext-trunc.ll
new file mode 100644
index 0000000000..b9ffbe87b2
--- /dev/null
+++ b/test/CodeGen/X86/zext-trunc.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -march=x86-64 | FileCheck %s
+; rdar://7570931
+
+define i64 @foo(i64 %a, i64 %b) nounwind {
+; CHECK: foo:
+; CHECK: leal
+; CHECK-NOT: movl
+; CHECK: ret
+ %c = add i64 %a, %b
+ %d = trunc i64 %c to i32
+ %e = zext i32 %d to i64
+ ret i64 %e
+}