Enable machine cse pass.
[oota-llvm.git] / test / CodeGen / X86 / machine-cse.ll
1 ; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
2 ; rdar://7610418
3
4 %ptr = type { i8* }
5 %struct.s1 = type { %ptr, %ptr }
6 %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] }
7 %struct.s3 = type { %struct.s3*, %struct.s3*, i32, i32, i32 }
8
9 define fastcc i8* @t(i64 %size) nounwind {
10 entry:
11 ; CHECK: t:
12 ; CHECK: leaq (%rax,%rax,4)
13   %0 = zext i32 undef to i64
14   %1 = getelementptr inbounds %struct.s2* null, i64 %0
15   br i1 undef, label %bb1, label %bb2
16
17 bb1:
18 ; CHECK: %bb1
19 ; CHECK-NOT: shlq $9
20 ; CHECK-NOT: leaq
21 ; CHECK: call
22   %2 = getelementptr inbounds %struct.s2* null, i64 %0, i32 0
23   call void @bar(i32* %2) nounwind
24   unreachable
25
26 bb2:
27 ; CHECK: %bb2
28 ; CHECK-NOT: leaq
29 ; CHECK: callq
30   %3 = call fastcc i8* @foo(%struct.s2* %1) nounwind
31   unreachable
32
33 bb3:
34   ret i8* undef
35 }
36
37 declare void @bar(i32*)
38
39 declare fastcc i8* @foo(%struct.s2*) nounwind