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: %ext = sext i16 ptrtoint (ptr @global to i16) to i32
285 ; PTR64_IDX64-NEXT: --> (sext i16 (trunc i64 (ptrtoint ptr @global to i64) to i16) to i32) U: [-32768,32768) S: [-32768,32768) Exits: (sext i16 (trunc i64 (ptrtoint ptr @global to i64) to i16) to i32) LoopDispositions: { %bb7: Invariant }
286 ; PTR64_IDX64-NEXT: %tmp = sub i32 %arg, %ext
287 ; 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 }
288 ; PTR64_IDX64-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
289 ; PTR64_IDX64-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
290 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @sext_to_i32
291 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable backedge-taken count.
292 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
293 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
294 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
296 ; PTR64_IDX32-LABEL: 'sext_to_i32'
297 ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_to_i32
298 ; PTR64_IDX32-NEXT: %ext = sext i16 ptrtoint (ptr @global to i16) to i32
299 ; PTR64_IDX32-NEXT: --> (sext i16 ptrtoint (ptr @global to i16) to i32) U: [-32768,32768) S: [-32768,32768) Exits: (sext i16 ptrtoint (ptr @global to i16) to i32) LoopDispositions: { %bb7: Invariant }
300 ; PTR64_IDX32-NEXT: %tmp = sub i32 %arg, %ext
301 ; 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 }
302 ; PTR64_IDX32-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
303 ; PTR64_IDX32-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
304 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @sext_to_i32
305 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable backedge-taken count.
306 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
307 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
308 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
310 ; PTR16_IDX16-LABEL: 'sext_to_i32'
311 ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_to_i32
312 ; PTR16_IDX16-NEXT: %ext = sext i16 ptrtoint (ptr @global to i16) to i32
313 ; PTR16_IDX16-NEXT: --> (sext i16 (ptrtoint ptr @global to i16) to i32) U: [-32768,32768) S: [-32768,32768) Exits: (sext i16 (ptrtoint ptr @global to i16) to i32) LoopDispositions: { %bb7: Invariant }
314 ; PTR16_IDX16-NEXT: %tmp = sub i32 %arg, %ext
315 ; 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 }
316 ; PTR16_IDX16-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
317 ; PTR16_IDX16-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
318 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @sext_to_i32
319 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable backedge-taken count.
320 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
321 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
322 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable predicated backedge-taken count.
327 bb7: ; preds = %bb7, %bb
328 %ext = sext i16 ptrtoint (ptr @global to i16) to i32
329 %tmp = sub i32 %arg, %ext
330 %tmp8 = icmp eq i32 %tmp, %arg6
331 %tmp9 = select i1 %tmp8, i16 0, i16 1
332 call void @use16(i16 %tmp9)
333 br i1 %tmp8, label %bb7, label %bb10
339 define i64 @sext_like_noop(i32 %n) {
340 ; PTR64_IDX64-LABEL: 'sext_like_noop'
341 ; PTR64_IDX64-NEXT: Classifying expressions for: @sext_like_noop
342 ; PTR64_IDX64-NEXT: %ii = sext i32 %i to i64
343 ; 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)
344 ; PTR64_IDX64-NEXT: %div = sdiv i64 55555, %ii
345 ; PTR64_IDX64-NEXT: --> %div U: full-set S: full-set
346 ; PTR64_IDX64-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
347 ; 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 }
348 ; PTR64_IDX64-NEXT: %inc = add nuw i32 %i, 1
349 ; 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 }
350 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @sext_like_noop
351 ; PTR64_IDX64-NEXT: Loop %for.body: backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
352 ; PTR64_IDX64-NEXT: Loop %for.body: constant max backedge-taken count is -1
353 ; PTR64_IDX64-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
354 ; PTR64_IDX64-NEXT: Loop %for.body: Predicated backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
355 ; PTR64_IDX64-NEXT: Predicates:
356 ; PTR64_IDX64-NEXT: Loop %for.body: Trip multiple is 1
358 ; PTR64_IDX32-LABEL: 'sext_like_noop'
359 ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_like_noop
360 ; PTR64_IDX32-NEXT: %ii = sext i32 %i to i64
361 ; 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)
362 ; PTR64_IDX32-NEXT: %div = sdiv i64 55555, %ii
363 ; PTR64_IDX32-NEXT: --> %div U: full-set S: full-set
364 ; PTR64_IDX32-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
365 ; 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 }
366 ; PTR64_IDX32-NEXT: %inc = add nuw i32 %i, 1
367 ; 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 }
368 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @sext_like_noop
369 ; PTR64_IDX32-NEXT: Loop %for.body: backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
370 ; PTR64_IDX32-NEXT: Loop %for.body: constant max backedge-taken count is -1
371 ; PTR64_IDX32-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
372 ; PTR64_IDX32-NEXT: Loop %for.body: Predicated backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
373 ; PTR64_IDX32-NEXT: Predicates:
374 ; PTR64_IDX32-NEXT: Loop %for.body: Trip multiple is 1
376 ; PTR16_IDX16-LABEL: 'sext_like_noop'
377 ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_like_noop
378 ; PTR16_IDX16-NEXT: %ii = sext i32 %i to i64
379 ; 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)
380 ; PTR16_IDX16-NEXT: %div = sdiv i64 55555, %ii
381 ; PTR16_IDX16-NEXT: --> %div U: full-set S: full-set
382 ; PTR16_IDX16-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
383 ; 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 }
384 ; PTR16_IDX16-NEXT: %inc = add nuw i32 %i, 1
385 ; 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 }
386 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @sext_like_noop
387 ; PTR16_IDX16-NEXT: Loop %for.body: backedge-taken count is (-2 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw>
388 ; PTR16_IDX16-NEXT: Loop %for.body: constant max backedge-taken count is -1
389 ; 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>
390 ; PTR16_IDX16-NEXT: Loop %for.body: Predicated backedge-taken count is (-2 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw>
391 ; PTR16_IDX16-NEXT: Predicates:
392 ; PTR16_IDX16-NEXT: Loop %for.body: Trip multiple is 1
395 %cmp6 = icmp sgt i32 %n, 1
399 %ii = sext i32 %i to i64
400 %div = sdiv i64 55555, %ii
404 %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
405 %inc = add nuw i32 %i, 1
406 %exitcond = icmp eq i32 %inc, ptrtoint (ptr @sext_like_noop to i32)
407 br i1 %exitcond, label %for.cond.cleanup, label %for.body