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.
28 ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i64'
29 ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i64
30 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
31 ; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
32 ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
33 ; 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 }
34 ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
35 ; 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 }
36 ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
37 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
38 ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2
39 ; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
40 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64
41 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count.
42 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
43 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
45 ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i64'
46 ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i64
47 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
48 ; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
49 ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
50 ; 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 }
51 ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
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: %tmp14 = load i32, ptr %tmp13, align 4
54 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
55 ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2
56 ; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
57 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i64
58 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count.
59 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
60 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
65 bb11: ; preds = %bb17, %bb
66 %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
67 %tmp12 = getelementptr i8, ptr %arg, i64 ptrtoint (ptr @global to i64)
68 %tmp13 = bitcast ptr %tmp12 to ptr
69 %tmp14 = load i32, ptr %tmp13, align 4
70 %tmp15 = icmp eq i32 %tmp14, 6
71 br i1 %tmp15, label %bb16, label %bb17
77 %tmp18 = add i32 %tmp, 2
80 define hidden ptr @trunc_ptr_to_i32(ptr %arg, ptr %arg10) {
81 ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i32'
82 ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i32
83 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
84 ; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
85 ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
86 ; 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 }
87 ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
88 ; 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 }
89 ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
90 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
91 ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2
92 ; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
93 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32
94 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count.
95 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
96 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
98 ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i32'
99 ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i32
100 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
101 ; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
102 ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
103 ; 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 }
104 ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
105 ; 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 }
106 ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
107 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
108 ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2
109 ; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
110 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32
111 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count.
112 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
113 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
115 ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i32'
116 ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i32
117 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
118 ; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
119 ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
120 ; 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 }
121 ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
122 ; 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 }
123 ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
124 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
125 ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2
126 ; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
127 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i32
128 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count.
129 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
130 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
135 bb11: ; preds = %bb17, %bb
136 %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
137 %tmp12 = getelementptr i8, ptr %arg, i32 ptrtoint (ptr @global to i32)
138 %tmp13 = bitcast ptr %tmp12 to ptr
139 %tmp14 = load i32, ptr %tmp13, align 4
140 %tmp15 = icmp eq i32 %tmp14, 6
141 br i1 %tmp15, label %bb16, label %bb17
143 bb16: ; preds = %bb11
146 bb17: ; preds = %bb11
147 %tmp18 = add i32 %tmp, 2
150 define hidden ptr @trunc_ptr_to_i128(ptr %arg, ptr %arg10) {
151 ; PTR64_IDX64-LABEL: 'trunc_ptr_to_i128'
152 ; PTR64_IDX64-NEXT: Classifying expressions for: @trunc_ptr_to_i128
153 ; PTR64_IDX64-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
154 ; PTR64_IDX64-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
155 ; PTR64_IDX64-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
156 ; 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 }
157 ; PTR64_IDX64-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
158 ; 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 }
159 ; PTR64_IDX64-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
160 ; PTR64_IDX64-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
161 ; PTR64_IDX64-NEXT: %tmp18 = add i32 %tmp, 2
162 ; PTR64_IDX64-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
163 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128
164 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable backedge-taken count.
165 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
166 ; PTR64_IDX64-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
168 ; PTR64_IDX32-LABEL: 'trunc_ptr_to_i128'
169 ; PTR64_IDX32-NEXT: Classifying expressions for: @trunc_ptr_to_i128
170 ; PTR64_IDX32-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
171 ; PTR64_IDX32-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
172 ; PTR64_IDX32-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
173 ; 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 }
174 ; PTR64_IDX32-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
175 ; 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 }
176 ; PTR64_IDX32-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
177 ; PTR64_IDX32-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
178 ; PTR64_IDX32-NEXT: %tmp18 = add i32 %tmp, 2
179 ; PTR64_IDX32-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
180 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128
181 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable backedge-taken count.
182 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
183 ; PTR64_IDX32-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
185 ; PTR16_IDX16-LABEL: 'trunc_ptr_to_i128'
186 ; PTR16_IDX16-NEXT: Classifying expressions for: @trunc_ptr_to_i128
187 ; PTR16_IDX16-NEXT: %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
188 ; PTR16_IDX16-NEXT: --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
189 ; PTR16_IDX16-NEXT: %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
190 ; 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 }
191 ; PTR16_IDX16-NEXT: %tmp13 = bitcast ptr %tmp12 to ptr
192 ; 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 }
193 ; PTR16_IDX16-NEXT: %tmp14 = load i32, ptr %tmp13, align 4
194 ; PTR16_IDX16-NEXT: --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
195 ; PTR16_IDX16-NEXT: %tmp18 = add i32 %tmp, 2
196 ; PTR16_IDX16-NEXT: --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
197 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @trunc_ptr_to_i128
198 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable backedge-taken count.
199 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable constant max backedge-taken count.
200 ; PTR16_IDX16-NEXT: Loop %bb11: Unpredictable symbolic max backedge-taken count.
205 bb11: ; preds = %bb17, %bb
206 %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
207 %tmp12 = getelementptr i8, ptr %arg, i128 ptrtoint (ptr @global to i128)
208 %tmp13 = bitcast ptr %tmp12 to ptr
209 %tmp14 = load i32, ptr %tmp13, align 4
210 %tmp15 = icmp eq i32 %tmp14, 6
211 br i1 %tmp15, label %bb16, label %bb17
213 bb16: ; preds = %bb11
216 bb17: ; preds = %bb11
217 %tmp18 = add i32 %tmp, 2
221 define void @zext_ptr_to_i32(i32 %arg, i32 %arg6) {
222 ; PTR64_IDX64-LABEL: 'zext_ptr_to_i32'
223 ; PTR64_IDX64-NEXT: Classifying expressions for: @zext_ptr_to_i32
224 ; PTR64_IDX64-NEXT: %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
225 ; 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 }
226 ; PTR64_IDX64-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
227 ; PTR64_IDX64-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
228 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @zext_ptr_to_i32
229 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable backedge-taken count.
230 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
231 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
233 ; PTR64_IDX32-LABEL: 'zext_ptr_to_i32'
234 ; PTR64_IDX32-NEXT: Classifying expressions for: @zext_ptr_to_i32
235 ; PTR64_IDX32-NEXT: %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
236 ; 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 }
237 ; PTR64_IDX32-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
238 ; PTR64_IDX32-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
239 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @zext_ptr_to_i32
240 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable backedge-taken count.
241 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
242 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
244 ; PTR16_IDX16-LABEL: 'zext_ptr_to_i32'
245 ; PTR16_IDX16-NEXT: Classifying expressions for: @zext_ptr_to_i32
246 ; PTR16_IDX16-NEXT: %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
247 ; 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 }
248 ; PTR16_IDX16-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
249 ; PTR16_IDX16-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
250 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @zext_ptr_to_i32
251 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable backedge-taken count.
252 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
253 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
258 bb7: ; preds = %bb7, %bb
259 %tmp = sub i32 %arg, ptrtoint (ptr @global to i32)
260 %tmp8 = icmp eq i32 %tmp, %arg6
261 %tmp9 = select i1 %tmp8, i16 0, i16 1
262 call void @use16(i16 %tmp9)
263 br i1 %tmp8, label %bb7, label %bb10
269 define void @sext_to_i32(i32 %arg, i32 %arg6) {
270 ; PTR64_IDX64-LABEL: 'sext_to_i32'
271 ; PTR64_IDX64-NEXT: Classifying expressions for: @sext_to_i32
272 ; PTR64_IDX64-NEXT: %ext = sext i16 ptrtoint (ptr @global to i16) to i32
273 ; 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 }
274 ; PTR64_IDX64-NEXT: %tmp = sub i32 %arg, %ext
275 ; 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 }
276 ; PTR64_IDX64-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
277 ; PTR64_IDX64-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
278 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @sext_to_i32
279 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable backedge-taken count.
280 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
281 ; PTR64_IDX64-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
283 ; PTR64_IDX32-LABEL: 'sext_to_i32'
284 ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_to_i32
285 ; PTR64_IDX32-NEXT: %ext = sext i16 ptrtoint (ptr @global to i16) to i32
286 ; 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 }
287 ; PTR64_IDX32-NEXT: %tmp = sub i32 %arg, %ext
288 ; 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 }
289 ; PTR64_IDX32-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
290 ; PTR64_IDX32-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
291 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @sext_to_i32
292 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable backedge-taken count.
293 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
294 ; PTR64_IDX32-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
296 ; PTR16_IDX16-LABEL: 'sext_to_i32'
297 ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_to_i32
298 ; PTR16_IDX16-NEXT: %ext = sext i16 ptrtoint (ptr @global to i16) to i32
299 ; 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 }
300 ; PTR16_IDX16-NEXT: %tmp = sub i32 %arg, %ext
301 ; 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 }
302 ; PTR16_IDX16-NEXT: %tmp9 = select i1 %tmp8, i16 0, i16 1
303 ; PTR16_IDX16-NEXT: --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
304 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @sext_to_i32
305 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable backedge-taken count.
306 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable constant max backedge-taken count.
307 ; PTR16_IDX16-NEXT: Loop %bb7: Unpredictable symbolic max backedge-taken count.
312 bb7: ; preds = %bb7, %bb
313 %ext = sext i16 ptrtoint (ptr @global to i16) to i32
314 %tmp = sub i32 %arg, %ext
315 %tmp8 = icmp eq i32 %tmp, %arg6
316 %tmp9 = select i1 %tmp8, i16 0, i16 1
317 call void @use16(i16 %tmp9)
318 br i1 %tmp8, label %bb7, label %bb10
324 define i64 @sext_like_noop(i32 %n) {
325 ; PTR64_IDX64-LABEL: 'sext_like_noop'
326 ; PTR64_IDX64-NEXT: Classifying expressions for: @sext_like_noop
327 ; PTR64_IDX64-NEXT: %ii = sext i32 %i to i64
328 ; 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)
329 ; PTR64_IDX64-NEXT: %div = sdiv i64 55555, %ii
330 ; PTR64_IDX64-NEXT: --> %div U: full-set S: full-set
331 ; PTR64_IDX64-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
332 ; 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 }
333 ; PTR64_IDX64-NEXT: %inc = add nuw i32 %i, 1
334 ; 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 }
335 ; PTR64_IDX64-NEXT: Determining loop execution counts for: @sext_like_noop
336 ; PTR64_IDX64-NEXT: Loop %for.body: backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
337 ; PTR64_IDX64-NEXT: Loop %for.body: constant max backedge-taken count is i32 -1
338 ; PTR64_IDX64-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + (trunc i64 (ptrtoint ptr @sext_like_noop to i64) to i32))
339 ; PTR64_IDX64-NEXT: Loop %for.body: Trip multiple is 1
341 ; PTR64_IDX32-LABEL: 'sext_like_noop'
342 ; PTR64_IDX32-NEXT: Classifying expressions for: @sext_like_noop
343 ; PTR64_IDX32-NEXT: %ii = sext i32 %i to i64
344 ; 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)
345 ; PTR64_IDX32-NEXT: %div = sdiv i64 55555, %ii
346 ; PTR64_IDX32-NEXT: --> %div U: full-set S: full-set
347 ; PTR64_IDX32-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
348 ; 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 }
349 ; PTR64_IDX32-NEXT: %inc = add nuw i32 %i, 1
350 ; 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 }
351 ; PTR64_IDX32-NEXT: Determining loop execution counts for: @sext_like_noop
352 ; PTR64_IDX32-NEXT: Loop %for.body: backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
353 ; PTR64_IDX32-NEXT: Loop %for.body: constant max backedge-taken count is i32 -1
354 ; PTR64_IDX32-NEXT: Loop %for.body: symbolic max backedge-taken count is (-2 + ptrtoint (ptr @sext_like_noop to i32))
355 ; PTR64_IDX32-NEXT: Loop %for.body: Trip multiple is 1
357 ; PTR16_IDX16-LABEL: 'sext_like_noop'
358 ; PTR16_IDX16-NEXT: Classifying expressions for: @sext_like_noop
359 ; PTR16_IDX16-NEXT: %ii = sext i32 %i to i64
360 ; 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)
361 ; PTR16_IDX16-NEXT: %div = sdiv i64 55555, %ii
362 ; PTR16_IDX16-NEXT: --> %div U: full-set S: full-set
363 ; PTR16_IDX16-NEXT: %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
364 ; 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 }
365 ; PTR16_IDX16-NEXT: %inc = add nuw i32 %i, 1
366 ; 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 }
367 ; PTR16_IDX16-NEXT: Determining loop execution counts for: @sext_like_noop
368 ; PTR16_IDX16-NEXT: Loop %for.body: backedge-taken count is (-2 + (zext i16 (ptrtoint ptr @sext_like_noop to i16) to i32))<nsw>
369 ; PTR16_IDX16-NEXT: Loop %for.body: constant max backedge-taken count is i32 -1
370 ; 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>
371 ; PTR16_IDX16-NEXT: Loop %for.body: Trip multiple is 1
374 %cmp6 = icmp sgt i32 %n, 1
378 %ii = sext i32 %i to i64
379 %div = sdiv i64 55555, %ii
383 %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
384 %inc = add nuw i32 %i, 1
385 %exitcond = icmp eq i32 %inc, ptrtoint (ptr @sext_like_noop to i32)
386 br i1 %exitcond, label %for.cond.cleanup, label %for.body