summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/machine-cse.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-10 03:07:41 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-10 03:07:41 +0000
commitfac4f1f1815b54346a805834a8c19d573ce8856c (patch)
tree7d96230aae477b51f64bbdeaab85a8dd9f4e8427 /test/CodeGen/X86/machine-cse.ll
parent974c0fb4047f7d9f190f6ca5780c7a06e6c40914 (diff)
downloadllvm-fac4f1f1815b54346a805834a8c19d573ce8856c.tar.gz
llvm-fac4f1f1815b54346a805834a8c19d573ce8856c.tar.bz2
llvm-fac4f1f1815b54346a805834a8c19d573ce8856c.tar.xz
Enable machine cse pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/machine-cse.ll')
-rw-r--r--test/CodeGen/X86/machine-cse.ll39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/CodeGen/X86/machine-cse.ll b/test/CodeGen/X86/machine-cse.ll
new file mode 100644
index 0000000000..a8afdc84c5
--- /dev/null
+++ b/test/CodeGen/X86/machine-cse.ll
@@ -0,0 +1,39 @@
+; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
+; rdar://7610418
+
+%ptr = type { i8* }
+%struct.s1 = type { %ptr, %ptr }
+%struct.s2 = type { i32, i8*, i8*, [256 x %struct.s1*], [8 x i32], i64, i8*, i32, i64, i64, i32, %struct.s3*, %struct.s3*, [49 x i64] }
+%struct.s3 = type { %struct.s3*, %struct.s3*, i32, i32, i32 }
+
+define fastcc i8* @t(i64 %size) nounwind {
+entry:
+; CHECK: t:
+; CHECK: leaq (%rax,%rax,4)
+ %0 = zext i32 undef to i64
+ %1 = getelementptr inbounds %struct.s2* null, i64 %0
+ br i1 undef, label %bb1, label %bb2
+
+bb1:
+; CHECK: %bb1
+; CHECK-NOT: shlq $9
+; CHECK-NOT: leaq
+; CHECK: call
+ %2 = getelementptr inbounds %struct.s2* null, i64 %0, i32 0
+ call void @bar(i32* %2) nounwind
+ unreachable
+
+bb2:
+; CHECK: %bb2
+; CHECK-NOT: leaq
+; CHECK: callq
+ %3 = call fastcc i8* @foo(%struct.s2* %1) nounwind
+ unreachable
+
+bb3:
+ ret i8* undef
+}
+
+declare void @bar(i32*)
+
+declare fastcc i8* @foo(%struct.s2*) nounwind