[X86] Don't pass a scale value of 0 to scatter/gather intrinsics. This causes the...
[oota-llvm.git] / test / CodeGen / X86 / code_placement_loop_rotation.ll
1 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s | FileCheck %s -check-prefix=CHECK
2 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -precise-rotation-cost < %s | FileCheck %s -check-prefix=CHECK-PROFILE
3
4 define void @foo() {
5 ; Test that not all edges in the loop chain are fall through without profile
6 ; data.
7 ;
8 ; CHECK-LABEL: foo:
9 ; CHECK: callq e
10 ; CHECK: callq f
11 ; CHECK: callq g
12 ; CHECK: callq h
13
14 entry:
15   br label %header
16
17 header:
18   call void @e()
19   %call = call zeroext i1 @a()
20   br i1 %call, label %if.then, label %if.else, !prof !2
21
22 if.then:
23   call void @f()
24   br label %if.end
25
26 if.else:
27   call void @g()
28   br label %if.end
29
30 if.end:
31   call void @h()
32   %call2 = call zeroext i1 @a()
33   br i1 %call2, label %header, label %end
34
35 end:
36   ret void
37 }
38
39 define void @bar() !prof !1 {
40 ; Test that all edges in the loop chain are fall through with profile data.
41 ;
42 ; CHECK-PROFILE-LABEL: bar:
43 ; CHECK-PROFILE: callq g
44 ; CHECK-PROFILE: callq h
45 ; CHECK-PROFILE: callq e
46 ; CHECK-PROFILE: callq f
47
48 entry:
49   br label %header
50
51 header:
52   call void @e()
53   %call = call zeroext i1 @a()
54   br i1 %call, label %if.then, label %if.else, !prof !2
55
56 if.then:
57   call void @f()
58   br label %if.end
59
60 if.else:
61   call void @g()
62   br label %if.end
63
64 if.end:
65   call void @h()
66   %call2 = call zeroext i1 @a()
67   br i1 %call2, label %header, label %end
68
69 end:
70   ret void
71 }
72
73 declare zeroext i1 @a()
74 declare void @e()
75 declare void @f()
76 declare void @g()
77 declare void @h()
78
79 !1 = !{!"function_entry_count", i64 1}
80 !2 = !{!"branch_weights", i32 16, i32 16}