llvm.org GIT mirror llvm / 8ca441a
Test cases that assume layout should use -disable-code-place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154908 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 7 years ago
1 changed file(s) with 174 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llc < %s -march=x86 -disable-code-place | FileCheck %s
1 ;
2 ; Test RegistersDefinedFromSameValue. We have multiple copies of the same vreg:
3 ; while.body85.i:
4 ; vreg1 = copy vreg2
5 ; vreg2 = add
6 ; critical edge from land.lhs.true.i -> if.end117.i:
7 ; vreg27 = vreg2
8 ; critical edge from land.lhs.true103.i -> if.end117.i:
9 ; vreg27 = vreg2
10 ; if.then108.i:
11 ; vreg27 = vreg1
12 ;
13 ; Prior to fixing PR10920 401.bzip miscompile, the coalescer would
14 ; consider vreg1 and vreg27 to be copies of the same value. It would
15 ; then remove one of the critical edge copes, which cannot safely be removed.
16 ;
17 ; CHECK: # %while.body85.i
18 ; CHECK-NOT: # %
19 ; CHECK-NOT: add
20 ; CHECK: movl %[[POSTR:e[abcdxi]+]], %[[PRER:e[abcdxi]+]]
21 ; CHECK: addl %{{.*}}, %[[POSTR]]
22 ; CHECK: # %while.end.i
23 ; CHECK: movl %[[POSTR]], %[[USER:e[abcdxi]+]]
24 ; CHECK: # %land.lhs.true.i
25 ; CHECK: movl %[[POSTR]], %[[USER]]
26 ; CHECK: # %land.lhs.true103.i
27 ; CHECK: movl %[[POSTR]], %[[USER]]
28 ; CHECK: # %if.then108.i
29 ; [[PRER] live out, so nothing on this path should define it.
30 ; CHECK-NOT: , %[[PRER]]
31 ; CHECK: # %if.end117.i
32
33 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
34
35 @.str3 = external unnamed_addr constant [59 x i8], align 1
36
37 define void @BZ2_compressBlock() nounwind ssp {
38 entry:
39 br i1 undef, label %if.then68, label %if.end85
40
41 if.then68: ; preds = %entry
42 br label %for.body.i.i
43
44 for.body.i.i: ; preds = %for.inc.i.i, %if.then68
45 br i1 undef, label %for.inc.i.i, label %if.then.i.i
46
47 if.then.i.i: ; preds = %for.body.i.i
48 br label %for.inc.i.i
49
50 for.inc.i.i: ; preds = %if.then.i.i, %for.body.i.i
51 br i1 undef, label %makeMaps_e.exit.i, label %for.body.i.i
52
53 makeMaps_e.exit.i: ; preds = %for.inc.i.i
54 br i1 undef, label %for.cond19.preheader.i, label %for.cond.for.cond19.preheader_crit_edge.i
55
56 for.cond.for.cond19.preheader_crit_edge.i: ; preds = %makeMaps_e.exit.i
57 unreachable
58
59 for.cond19.preheader.i: ; preds = %makeMaps_e.exit.i
60 br i1 undef, label %for.body25.lr.ph.i, label %for.cond33.preheader.i
61
62 for.body25.lr.ph.i: ; preds = %for.cond19.preheader.i
63 br label %for.body25.i
64
65 for.cond33.preheader.i: ; preds = %for.body25.i, %for.cond19.preheader.i
66 br i1 undef, label %if.then.i, label %if.end.i
67
68 for.body25.i: ; preds = %for.body25.i, %for.body25.lr.ph.i
69 br i1 undef, label %for.body25.i, label %for.cond33.preheader.i
70
71 if.then.i: ; preds = %for.cond33.preheader.i
72 br label %if.end.i
73
74 if.end.i: ; preds = %if.then.i, %for.cond33.preheader.i
75 br i1 undef, label %for.inc27.us.5.i, label %for.end30.i
76
77 for.end30.i: ; preds = %for.inc27.us.5.i, %if.end.i
78 br i1 undef, label %if.end36.i, label %if.then35.i
79
80 if.then35.i: ; preds = %for.end30.i
81 unreachable
82
83 if.end36.i: ; preds = %for.end30.i
84 %sub83.i = add nsw i32 undef, 1
85 br label %while.body.i188
86
87 for.cond182.preheader.i: ; preds = %for.end173.i
88 br i1 undef, label %for.inc220.us.i, label %while.body300.preheader.i
89
90 while.body.i188: ; preds = %for.end173.i, %if.end36.i
91 %gs.0526.i = phi i32 [ 0, %if.end36.i ], [ %add177.i, %for.end173.i ]
92 %or.cond514517.i = and i1 false, undef
93 br i1 %or.cond514517.i, label %while.body85.i, label %if.end117.i
94
95 while.body85.i: ; preds = %while.body85.i, %while.body.i188
96 %aFreq.0518.i = phi i32 [ %add93.i, %while.body85.i ], [ 0, %while.body.i188 ]
97 %inc87.i = add nsw i32 0, 1
98 %tmp91.i = load i32* undef, align 4, !tbaa !0
99 %add93.i = add nsw i32 %tmp91.i, %aFreq.0518.i
100 %or.cond514.i = and i1 undef, false
101 br i1 %or.cond514.i, label %while.body85.i, label %while.end.i
102
103 while.end.i: ; preds = %while.body85.i
104 br i1 undef, label %land.lhs.true.i, label %if.end117.i
105
106 land.lhs.true.i: ; preds = %while.end.i
107 br i1 undef, label %land.lhs.true103.i, label %if.end117.i
108
109 land.lhs.true103.i: ; preds = %land.lhs.true.i
110 br i1 undef, label %if.then108.i, label %if.end117.i
111
112 if.then108.i: ; preds = %land.lhs.true103.i
113 br label %if.end117.i
114
115 if.end117.i: ; preds = %if.then108.i, %land.lhs.true103.i, %land.lhs.true.i, %while.end.i, %while.body.i188
116 %aFreq.1.i = phi i32 [ %aFreq.0518.i, %if.then108.i ], [ %add93.i, %land.lhs.true103.i ], [ %add93.i, %land.lhs.true.i ], [ %add93.i, %while.end.i ], [ 0, %while.body.i188 ]
117 %ge.1.i = phi i32 [ 0, %if.then108.i ], [ %inc87.i, %land.lhs.true103.i ], [ %inc87.i, %land.lhs.true.i ], [ %inc87.i, %while.end.i ], [ 0, %while.body.i188 ]
118 br i1 undef, label %if.then122.i, label %for.cond138.preheader.i
119
120 if.then122.i: ; preds = %if.end117.i
121 call void (...)* @fprintf(i32 undef, i32 %gs.0526.i, i32 %ge.1.i, i32 %aFreq.1.i, double undef) nounwind
122 br label %for.cond138.preheader.i
123
124 for.cond138.preheader.i: ; preds = %if.then122.i, %if.end117.i
125 br i1 undef, label %for.body143.lr.ph.i, label %for.end173.i
126
127 for.body143.lr.ph.i: ; preds = %for.cond138.preheader.i
128 br label %for.body143.i
129
130 for.body143.i: ; preds = %for.body143.i, %for.body143.lr.ph.i
131 br i1 undef, label %for.end173.i, label %for.body143.i
132
133 for.end173.i: ; preds = %for.body143.i, %for.cond138.preheader.i
134 %add177.i = add nsw i32 %ge.1.i, 1
135 %cmp73.i = icmp sgt i32 undef, 0
136 br i1 %cmp73.i, label %while.body.i188, label %for.cond182.preheader.i
137
138 for.inc220.us.i: ; preds = %for.cond182.preheader.i
139 unreachable
140
141 while.body300.preheader.i: ; preds = %for.cond182.preheader.i
142 br i1 undef, label %for.end335.i, label %while.end2742.i
143
144 for.end335.i: ; preds = %for.end2039.i, %while.body300.preheader.i
145 br label %for.body2021.i
146
147 for.body2021.i: ; preds = %for.body2021.i, %for.end335.i
148 br i1 undef, label %for.body2021.i, label %for.end2039.i
149
150 for.end2039.i: ; preds = %for.body2021.i
151 br label %for.end335.i
152
153 while.end2742.i: ; preds = %while.body300.preheader.i
154 br i1 undef, label %if.then2748.i, label %for.body2778.i
155
156 if.then2748.i: ; preds = %while.end2742.i
157 unreachable
158
159 for.body2778.i: ; preds = %while.end2742.i
160 unreachable
161
162 for.inc27.us.5.i: ; preds = %if.end.i
163 br label %for.end30.i
164
165 if.end85: ; preds = %entry
166 ret void
167 }
168
169 declare void @fprintf(...) nounwind
170
171 !0 = metadata !{metadata !"int", metadata !1}
172 !1 = metadata !{metadata !"omnipotent char", metadata !2}
173 !2 = metadata !{metadata !"Simple C/C++ TBAA", null}