1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s --data-layout="p:64:64:64:64" -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck --check-prefixes=PTR64_IDX64 %s
3 ; RUN: opt < %s --data-layout="p:64:64:64:32" -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck --check-prefixes=PTR64_IDX32 %s
4 ; RUN: opt < %s --data-layout="p:16:16:16:16" -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck --check-prefixes=PTR16_IDX16 %s
6 @global = external hidden global [0 x i8]
8 declare void @use16(i16)
10 define hidden ptr @trunc_ptr_to_i64(ptr %arg, ptr %arg10) {
11 ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i64'
12 ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i64
13 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
14 ; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
15 ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
16 ; PTR64_IDX64-NEXT: --> ((ptrtoint ptr @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
17 ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
18 ; PTR64_IDX64-NEXT: --> ((ptrtoint ptr @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
19 ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
20 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
21 ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2
22 ; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
23 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64
24 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count.
25 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
26 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
27 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
29 ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i64'
30 ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i64
31 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
32 ; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
33 ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
34 ; PTR64_IDX32-NEXT: --> ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
35 ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
36 ; PTR64_IDX32-NEXT: --> ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i64 ptrtoint (ptr @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
37 ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
38 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
39 ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2
40 ; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
41 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64
42 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count.
43 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
44 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
45 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
47 ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i64'
48 ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i64
49 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
50 ; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
51 ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
52 ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
53 ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
54 ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
55 ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
56 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
57 ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2
58 ; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
59 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64
60 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count.
61 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
62 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
63 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
68 bb11: ; preds = %bb17, %bb
69 %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
70 %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
71 %tmp13 = bitcast ptr %tmp12 to ptr
72 %tmp14 = load i32, ptr %tmp13, align 4
73 %tmp15 = icmp eq i32 %tmp14, 6
74 br i1 %tmp15, label %bb16, label %bb17
80 %tmp18 = add i32 %tmp, 2
83 define hidden ptr @trunc_ptr_to_i32(ptr %arg, ptr %arg10) {
84 ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i32'
85 ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i32
86 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
87 ; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
88 ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
89 ; PTR64_IDX64-NEXT: --> ((sext i32 (trunc i64 (ptrtoint ptr @global to i64) to i32) to i64) + %arg) U: full-set S: full-set Exits: ((sext i32 (trunc i64 (ptrtoint ptr @global to i64) to i32) to i64) + %arg) LoopDispositions: { %bb11: Invariant }
90 ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
91 ; PTR64_IDX64-NEXT: --> ((sext i32 (trunc i64 (ptrtoint ptr @global to i64) to i32) to i64) + %arg) U: full-set S: full-set Exits: ((sext i32 (trunc i64 (ptrtoint ptr @global to i64) to i32) to i64) + %arg) LoopDispositions: { %bb11: Invariant }
92 ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
93 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
94 ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2
95 ; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
96 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32
97 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count.
98 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
99 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
100 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
102 ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i32'
103 ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i32
104 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
105 ; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
106 ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
107 ; PTR64_IDX32-NEXT: --> (ptrtoint (ptr @global to i32) + %arg) U: full-set S: full-set Exits: (ptrtoint (ptr @global to i32) + %arg) LoopDispositions: { %bb11: Invariant }
108 ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
109 ; PTR64_IDX32-NEXT: --> (ptrtoint (ptr @global to i32) + %arg) U: full-set S: full-set Exits: (ptrtoint (ptr @global to i32) + %arg) LoopDispositions: { %bb11: Invariant }
110 ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
111 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
112 ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2
113 ; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
114 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32
115 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count.
116 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
117 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
118 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
120 ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i32'
121 ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i32
122 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
123 ; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
124 ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
125 ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
126 ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
127 ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
128 ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
129 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
130 ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2
131 ; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
132 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32
133 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count.
134 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
135 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
136 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
141 bb11: ; preds = %bb17, %bb
142 %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
143 %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
144 %tmp13 = bitcast ptr %tmp12 to ptr
145 %tmp14 = load i32, ptr %tmp13, align 4
146 %tmp15 = icmp eq i32 %tmp14, 6
147 br i1 %tmp15, label %bb16, label %bb17
149 bb16: ; preds = %bb11
152 bb17: ; preds = %bb11
153 %tmp18 = add i32 %tmp, 2
156 define hidden ptr @trunc_ptr_to_i128(ptr %arg, ptr %arg10) {
157 ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i128'
158 ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i128
159 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
160 ; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
161 ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
162 ; PTR64_IDX64-NEXT: --> ((ptrtoint ptr @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
163 ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
164 ; PTR64_IDX64-NEXT: --> ((ptrtoint ptr @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
165 ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
166 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
167 ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2
168 ; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
169 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128
170 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count.
171 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
172 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
173 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
175 ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i128'
176 ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i128
177 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
178 ; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
179 ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
180 ; PTR64_IDX32-NEXT: --> ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
181 ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
182 ; PTR64_IDX32-NEXT: --> ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i128 ptrtoint (ptr @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
183 ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
184 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
185 ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2
186 ; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
187 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128
188 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count.
189 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
190 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
191 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
193 ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i128'
194 ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i128
195 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
196 ; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
197 ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
198 ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
199 ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
200 ; PTR16_IDX16-NEXT: --> ((ptrtoint ptr @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint ptr @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
201 ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
202 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
203 ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2
204 ; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
205 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128
206 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count.
207 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
208 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
209 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable predicated backedge-taken count.
214 bb11: ; preds = %bb17, %bb
215 %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
216 %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
217 %tmp13 = bitcast ptr %tmp12 to ptr
218 %tmp14 = load i32, ptr %tmp13, align 4
219 %tmp15 = icmp eq i32 %tmp14, 6
220 br i1 %tmp15, label %bb16, label %bb17
222 bb16: ; preds = %bb11
225 bb17: ; preds = %bb11
226 %tmp18 = add i32 %tmp, 2
230 define void @zext_ptr_to_i32(i32 %arg, i32 %arg6) {
231 ; PTR64_IDX64-LABEL: 'zext_ptr_to_i32'
232 ; PTR64_IDX64-NEXT: Classifying expressions for: @zext_ptr_to_i32
233 ; PTR64_IDX64-NEXT: %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
234 ; PTR64_IDX64-NEXT: --> ((-1 * (trunc i64 (ptrtoint ptr @global to i64) to i32)) + %arg) U: full-set S: full-set Exits: ((-1 * (trunc i64 (ptrtoint ptr @global to i64) to i32)) + %arg) LoopDispositions: { %bb7: Invariant }
235 ; PTR64_IDX64-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
236 ; PTR64_IDX64-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
237 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @zext_ptr_to_i32
238 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable backedge-taken count.
239 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
240 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
241 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
243 ; PTR64_IDX32-LABEL: 'zext_ptr_to_i32'
244 ; PTR64_IDX32-NEXT: Classifying expressions for: @zext_ptr_to_i32
245 ; PTR64_IDX32-NEXT: %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
246 ; PTR64_IDX32-NEXT: --> ((-1 * ptrtoint (ptr @global to i32)) + %arg) U: full-set S: full-set Exits: ((-1 * ptrtoint (ptr @global to i32)) + %arg) LoopDispositions: { %bb7: Invariant }
247 ; PTR64_IDX32-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
248 ; PTR64_IDX32-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
249 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @zext_ptr_to_i32
250 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable backedge-taken count.
251 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
252 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
253 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
255 ; PTR16_IDX16-LABEL: 'zext_ptr_to_i32'
256 ; PTR16_IDX16-NEXT: Classifying expressions for: @zext_ptr_to_i32
257 ; PTR16_IDX16-NEXT: %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
258 ; PTR16_IDX16-NEXT: --> ((-1 * (zext i16 (ptrtoint ptr @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (zext i16 (ptrtoint ptr @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
259 ; PTR16_IDX16-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
260 ; PTR16_IDX16-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
261 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @zext_ptr_to_i32
262 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable backedge-taken count.
263 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
264 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
265 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
270 bb7: ; preds = %bb7, %bb
271 %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
272 %tmp8 = icmp eq i32 %tmp, %arg6
273 %tmp9 = select i1 %tmp8, i16 0, i16 1
274 call void @use16(i16 %tmp9)
275 br i1 %tmp8, label %bb7, label %bb10
281 define void @sext_to_i32(i32 %arg, i32 %arg6) {
282 ; PTR64_IDX64-LABEL: 'sext_to_i32'
283 ; PTR64_IDX64-NEXT: Classifying expressions for: @sext_to_i32
284 ; PTR64_IDX64-NEXT: %tmp = sub i32 %arg, sext (i16 ptrtoint (ptr @global to i16) to i32)
285 ; PTR64_IDX64-NEXT: --> ((-1 * (sext i16 (trunc i64 (ptrtoint ptr @global to i64) to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 (trunc i64 (ptrtoint ptr @global to i64) to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
286 ; PTR64_IDX64-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
287 ; PTR64_IDX64-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
288 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @sext_to_i32
289 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable backedge-taken count.
290 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
291 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
292 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
294 ; PTR64_IDX32-LABEL: 'sext_to_i32'
295 ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_to_i32
296 ; PTR64_IDX32-NEXT: %tmp = sub i32 %arg, sext (i16 ptrtoint (ptr @global to i16) to i32)
297 ; PTR64_IDX32-NEXT: --> ((-1 * (sext i16 ptrtoint (ptr @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 ptrtoint (ptr @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
298 ; PTR64_IDX32-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
299 ; PTR64_IDX32-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
300 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @sext_to_i32
301 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable backedge-taken count.
302 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
303 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
304 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
306 ; PTR16_IDX16-LABEL: 'sext_to_i32'
307 ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_to_i32
308 ; PTR16_IDX16-NEXT: %tmp = sub i32 %arg, sext (i16 ptrtoint (ptr @global to i16) to i32)
309 ; PTR16_IDX16-NEXT: --> ((-1 * (sext i16 (ptrtoint ptr @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 (ptrtoint ptr @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
310 ; PTR16_IDX16-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
311 ; PTR16_IDX16-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
312 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @sext_to_i32
313 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable backedge-taken count.
314 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
315 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
316 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
321 bb7: ; preds = %bb7, %bb
322 %tmp = sub i32 %arg, sext (i16 ptrtoint (ptr @global to i16) to i32)
323 %tmp8 = icmp eq i32 %tmp, %arg6
324 %tmp9 = select i1 %tmp8, i16 0, i16 1
325 call void @use16(i16 %tmp9)
326 br i1 %tmp8, label %bb7, label %bb10
332 define i64 @sext_like_noop(i32 %n) {
333 ; PTR64_IDX64-LABEL: 'sext_like_noop'
334 ; PTR64_IDX64-NEXT: Classifying expressions for: @sext_like_noop
335 ; PTR64_IDX64-NEXT: %ii = sext i32 %i to i64
336 ; PTR64_IDX64-NEXT: --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32)) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648)
337 ; PTR64_IDX64-NEXT: %div = sdiv i64 55555, %ii
338 ; PTR64_IDX64-NEXT: --> %div U: full-set S: full-set
339 ; PTR64_IDX64-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
340 ; PTR64_IDX64-NEXT: --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32)) LoopDispositions: { %for.body: Computable }
341 ; PTR64_IDX64-NEXT: %inc = add nuw i32 %i, 1
342 ; PTR64_IDX64-NEXT: --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32) LoopDispositions: { %for.body: Computable }
343 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @sext_like_noop
344 ; PTR64_IDX64-NEXT: Loop %for.body: backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
345 ; PTR64_IDX64-NEXT: Loop %for.body: constant max backedge-taken count is -1
346 ; PTR64_IDX64-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
347 ; PTR64_IDX64-NEXT: Loop %for.body: Predicated backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
348 ; PTR64_IDX64-NEXT: Predicates:
349 ; PTR64_IDX64: Loop %for.body: Trip multiple is 1
351 ; PTR64_IDX32-LABEL: 'sext_like_noop'
352 ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_like_noop
353 ; PTR64_IDX32-NEXT: %ii = sext i32 %i to i64
354 ; PTR64_IDX32-NEXT: --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + ptrtoint (ptr @sext_like_noop to i32)) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648)
355 ; PTR64_IDX32-NEXT: %div = sdiv i64 55555, %ii
356 ; PTR64_IDX32-NEXT: --> %div U: full-set S: full-set
357 ; PTR64_IDX32-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
358 ; PTR64_IDX32-NEXT: --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + ptrtoint (ptr @sext_like_noop to i32)) LoopDispositions: { %for.body: Computable }
359 ; PTR64_IDX32-NEXT: %inc = add nuw i32 %i, 1
360 ; PTR64_IDX32-NEXT: --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: ptrtoint (ptr @sext_like_noop to i32) LoopDispositions: { %for.body: Computable }
361 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @sext_like_noop
362 ; PTR64_IDX32-NEXT: Loop %for.body: backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
363 ; PTR64_IDX32-NEXT: Loop %for.body: constant max backedge-taken count is -1
364 ; PTR64_IDX32-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
365 ; PTR64_IDX32-NEXT: Loop %for.body: Predicated backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
366 ; PTR64_IDX32-NEXT: Predicates:
367 ; PTR64_IDX32: Loop %for.body: Trip multiple is 1
369 ; PTR16_IDX16-LABEL: 'sext_like_noop'
370 ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_like_noop
371 ; PTR16_IDX16-NEXT: %ii = sext i32 %i to i64
372 ; PTR16_IDX16-NEXT: --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i64))<nsw> U: [-1,65535) S: [-1,65535)
373 ; PTR16_IDX16-NEXT: %div = sdiv i64 55555, %ii
374 ; PTR16_IDX16-NEXT: --> %div U: full-set S: full-set
375 ; PTR16_IDX16-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
376 ; PTR16_IDX16-NEXT: --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw> LoopDispositions: { %for.body: Computable }
377 ; PTR16_IDX16-NEXT: %inc = add nuw i32 %i, 1
378 ; PTR16_IDX16-NEXT: --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32) LoopDispositions: { %for.body: Computable }
379 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @sext_like_noop
380 ; PTR16_IDX16-NEXT: Loop %for.body: backedge-taken count is (-2 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw>
381 ; PTR16_IDX16-NEXT: Loop %for.body: constant max backedge-taken count is -1
382 ; PTR16_IDX16-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw>
383 ; PTR16_IDX16-NEXT: Loop %for.body: Predicated backedge-taken count is (-2 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw>
384 ; PTR16_IDX16-NEXT: Predicates:
385 ; PTR16_IDX16: Loop %for.body: Trip multiple is 1
388 %cmp6 = icmp sgt i32 %n, 1
392 %ii = sext i32 %i to i64
393 %div = sdiv i64 55555, %ii
397 %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
398 %inc = add nuw i32 %i, 1
399 %exitcond = icmp eq i32 %inc, ptrtoint (ptr @sext_like_noop to i32)
400 br i1 %exitcond, label %for.cond.cleanup, label %for.body