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 -analyze -enable-new-pm=0 -scalar-evolution | FileCheck --check-prefixes=PTR64_IDX64 %s
3; 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
4; RUN: opt < %s --data-layout="p:64:64:64:32" -S -analyze -enable-new-pm=0 -scalar-evolution | FileCheck --check-prefixes=PTR64_IDX32 %s
5; 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
6; RUN: opt < %s --data-layout="p:16:16:16:16" -S -analyze -enable-new-pm=0 -scalar-evolution | FileCheck --check-prefixes=PTR16_IDX16 %s
7; 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
8; RUN: opt < %s --data-layout="p:16:16:16:32" -S -analyze -enable-new-pm=0 -scalar-evolution | FileCheck --check-prefixes=PTR16_IDX32 %s
9; RUN: opt < %s --data-layout="p:16:16:16:32" -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck --check-prefixes=PTR16_IDX32 %s
10
11@global = external hidden global [0 x i8]
12
13declare void @use16(i16)
14
15define hidden i32* @trunc_ptr_to_i64(i8* %arg, i32* %arg10) {
16; PTR64_IDX64-LABEL: 'trunc_ptr_to_i64'
17; PTR64_IDX64-NEXT:  Classifying expressions for: @trunc_ptr_to_i64
18; PTR64_IDX64-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
19; PTR64_IDX64-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
20; PTR64_IDX64-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i64 ptrtoint ([0 x i8]* @global to i64)
21; PTR64_IDX64-NEXT:    --> ((ptrtoint [0 x i8]* @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
22; PTR64_IDX64-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
23; PTR64_IDX64-NEXT:    --> ((ptrtoint [0 x i8]* @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
24; PTR64_IDX64-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
25; PTR64_IDX64-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
26; PTR64_IDX64-NEXT:    %tmp18 = add i32 %tmp, 2
27; PTR64_IDX64-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
28; PTR64_IDX64-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i64
29; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
30; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
31; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
32;
33; PTR64_IDX32-LABEL: 'trunc_ptr_to_i64'
34; PTR64_IDX32-NEXT:  Classifying expressions for: @trunc_ptr_to_i64
35; PTR64_IDX32-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
36; PTR64_IDX32-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
37; PTR64_IDX32-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i64 ptrtoint ([0 x i8]* @global to i64)
38; PTR64_IDX32-NEXT:    --> ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
39; PTR64_IDX32-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
40; PTR64_IDX32-NEXT:    --> ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
41; PTR64_IDX32-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
42; PTR64_IDX32-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
43; PTR64_IDX32-NEXT:    %tmp18 = add i32 %tmp, 2
44; PTR64_IDX32-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
45; PTR64_IDX32-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i64
46; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
47; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
48; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
49;
50; PTR16_IDX16-LABEL: 'trunc_ptr_to_i64'
51; PTR16_IDX16-NEXT:  Classifying expressions for: @trunc_ptr_to_i64
52; PTR16_IDX16-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
53; PTR16_IDX16-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
54; PTR16_IDX16-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i64 ptrtoint ([0 x i8]* @global to i64)
55; PTR16_IDX16-NEXT:    --> ((ptrtoint [0 x i8]* @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
56; PTR16_IDX16-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
57; PTR16_IDX16-NEXT:    --> ((ptrtoint [0 x i8]* @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
58; PTR16_IDX16-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
59; PTR16_IDX16-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
60; PTR16_IDX16-NEXT:    %tmp18 = add i32 %tmp, 2
61; PTR16_IDX16-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
62; PTR16_IDX16-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i64
63; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
64; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
65; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
66;
67; PTR16_IDX32-LABEL: 'trunc_ptr_to_i64'
68; PTR16_IDX32-NEXT:  Classifying expressions for: @trunc_ptr_to_i64
69; PTR16_IDX32-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
70; PTR16_IDX32-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
71; PTR16_IDX32-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i64 ptrtoint ([0 x i8]* @global to i64)
72; PTR16_IDX32-NEXT:    --> ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) U: [0,131071) S: [0,131071) Exits: ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
73; PTR16_IDX32-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
74; PTR16_IDX32-NEXT:    --> ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) U: [0,131071) S: [0,131071) Exits: ((trunc i64 ptrtoint ([0 x i8]* @global to i64) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
75; PTR16_IDX32-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
76; PTR16_IDX32-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
77; PTR16_IDX32-NEXT:    %tmp18 = add i32 %tmp, 2
78; PTR16_IDX32-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
79; PTR16_IDX32-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i64
80; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
81; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
82; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
83;
84bb:
85  br label %bb11
86
87bb11:                                             ; preds = %bb17, %bb
88  %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
89  %tmp12 = getelementptr i8, i8* %arg, i64 ptrtoint ([0 x i8]* @global to i64)
90  %tmp13 = bitcast i8* %tmp12 to i32*
91  %tmp14 = load i32, i32* %tmp13, align 4
92  %tmp15 = icmp eq i32 %tmp14, 6
93  br i1 %tmp15, label %bb16, label %bb17
94
95bb16:                                             ; preds = %bb11
96  ret i32* %arg10
97
98bb17:                                             ; preds = %bb11
99  %tmp18 = add i32 %tmp, 2
100  br label %bb11
101}
102define hidden i32* @trunc_ptr_to_i32(i8* %arg, i32* %arg10) {
103; PTR64_IDX64-LABEL: 'trunc_ptr_to_i32'
104; PTR64_IDX64-NEXT:  Classifying expressions for: @trunc_ptr_to_i32
105; PTR64_IDX64-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
106; PTR64_IDX64-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
107; PTR64_IDX64-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i32 ptrtoint ([0 x i8]* @global to i32)
108; PTR64_IDX64-NEXT:    --> ((sext i32 (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i32) to i64) + %arg) U: full-set S: full-set Exits: ((sext i32 (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i32) to i64) + %arg) LoopDispositions: { %bb11: Invariant }
109; PTR64_IDX64-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
110; PTR64_IDX64-NEXT:    --> ((sext i32 (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i32) to i64) + %arg) U: full-set S: full-set Exits: ((sext i32 (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i32) to i64) + %arg) LoopDispositions: { %bb11: Invariant }
111; PTR64_IDX64-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
112; PTR64_IDX64-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
113; PTR64_IDX64-NEXT:    %tmp18 = add i32 %tmp, 2
114; PTR64_IDX64-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
115; PTR64_IDX64-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i32
116; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
117; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
118; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
119;
120; PTR64_IDX32-LABEL: 'trunc_ptr_to_i32'
121; PTR64_IDX32-NEXT:  Classifying expressions for: @trunc_ptr_to_i32
122; PTR64_IDX32-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
123; PTR64_IDX32-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
124; PTR64_IDX32-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i32 ptrtoint ([0 x i8]* @global to i32)
125; PTR64_IDX32-NEXT:    --> (ptrtoint ([0 x i8]* @global to i32) + %arg) U: full-set S: full-set Exits: (ptrtoint ([0 x i8]* @global to i32) + %arg) LoopDispositions: { %bb11: Invariant }
126; PTR64_IDX32-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
127; PTR64_IDX32-NEXT:    --> (ptrtoint ([0 x i8]* @global to i32) + %arg) U: full-set S: full-set Exits: (ptrtoint ([0 x i8]* @global to i32) + %arg) LoopDispositions: { %bb11: Invariant }
128; PTR64_IDX32-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
129; PTR64_IDX32-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
130; PTR64_IDX32-NEXT:    %tmp18 = add i32 %tmp, 2
131; PTR64_IDX32-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
132; PTR64_IDX32-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i32
133; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
134; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
135; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
136;
137; PTR16_IDX16-LABEL: 'trunc_ptr_to_i32'
138; PTR16_IDX16-NEXT:  Classifying expressions for: @trunc_ptr_to_i32
139; PTR16_IDX16-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
140; PTR16_IDX16-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
141; PTR16_IDX16-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i32 ptrtoint ([0 x i8]* @global to i32)
142; PTR16_IDX16-NEXT:    --> ((ptrtoint [0 x i8]* @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
143; PTR16_IDX16-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
144; PTR16_IDX16-NEXT:    --> ((ptrtoint [0 x i8]* @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
145; PTR16_IDX16-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
146; PTR16_IDX16-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
147; PTR16_IDX16-NEXT:    %tmp18 = add i32 %tmp, 2
148; PTR16_IDX16-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
149; PTR16_IDX16-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i32
150; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
151; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
152; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
153;
154; PTR16_IDX32-LABEL: 'trunc_ptr_to_i32'
155; PTR16_IDX32-NEXT:  Classifying expressions for: @trunc_ptr_to_i32
156; PTR16_IDX32-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
157; PTR16_IDX32-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
158; PTR16_IDX32-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i32 ptrtoint ([0 x i8]* @global to i32)
159; PTR16_IDX32-NEXT:    --> (ptrtoint ([0 x i8]* @global to i32) + %arg) U: [0,131071) S: [0,131071) Exits: (ptrtoint ([0 x i8]* @global to i32) + %arg) LoopDispositions: { %bb11: Invariant }
160; PTR16_IDX32-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
161; PTR16_IDX32-NEXT:    --> (ptrtoint ([0 x i8]* @global to i32) + %arg) U: [0,131071) S: [0,131071) Exits: (ptrtoint ([0 x i8]* @global to i32) + %arg) LoopDispositions: { %bb11: Invariant }
162; PTR16_IDX32-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
163; PTR16_IDX32-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
164; PTR16_IDX32-NEXT:    %tmp18 = add i32 %tmp, 2
165; PTR16_IDX32-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
166; PTR16_IDX32-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i32
167; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
168; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
169; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
170;
171bb:
172  br label %bb11
173
174bb11:                                             ; preds = %bb17, %bb
175  %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
176  %tmp12 = getelementptr i8, i8* %arg, i32 ptrtoint ([0 x i8]* @global to i32)
177  %tmp13 = bitcast i8* %tmp12 to i32*
178  %tmp14 = load i32, i32* %tmp13, align 4
179  %tmp15 = icmp eq i32 %tmp14, 6
180  br i1 %tmp15, label %bb16, label %bb17
181
182bb16:                                             ; preds = %bb11
183  ret i32* %arg10
184
185bb17:                                             ; preds = %bb11
186  %tmp18 = add i32 %tmp, 2
187  br label %bb11
188}
189define hidden i32* @trunc_ptr_to_i128(i8* %arg, i32* %arg10) {
190; PTR64_IDX64-LABEL: 'trunc_ptr_to_i128'
191; PTR64_IDX64-NEXT:  Classifying expressions for: @trunc_ptr_to_i128
192; PTR64_IDX64-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
193; PTR64_IDX64-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
194; PTR64_IDX64-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i128 ptrtoint ([0 x i8]* @global to i128)
195; PTR64_IDX64-NEXT:    --> ((ptrtoint [0 x i8]* @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
196; PTR64_IDX64-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
197; PTR64_IDX64-NEXT:    --> ((ptrtoint [0 x i8]* @global to i64) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i64) + %arg) LoopDispositions: { %bb11: Invariant }
198; PTR64_IDX64-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
199; PTR64_IDX64-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
200; PTR64_IDX64-NEXT:    %tmp18 = add i32 %tmp, 2
201; PTR64_IDX64-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
202; PTR64_IDX64-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i128
203; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
204; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
205; PTR64_IDX64-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
206;
207; PTR64_IDX32-LABEL: 'trunc_ptr_to_i128'
208; PTR64_IDX32-NEXT:  Classifying expressions for: @trunc_ptr_to_i128
209; PTR64_IDX32-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
210; PTR64_IDX32-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
211; PTR64_IDX32-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i128 ptrtoint ([0 x i8]* @global to i128)
212; PTR64_IDX32-NEXT:    --> ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
213; PTR64_IDX32-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
214; PTR64_IDX32-NEXT:    --> ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) U: full-set S: full-set Exits: ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
215; PTR64_IDX32-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
216; PTR64_IDX32-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
217; PTR64_IDX32-NEXT:    %tmp18 = add i32 %tmp, 2
218; PTR64_IDX32-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
219; PTR64_IDX32-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i128
220; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
221; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
222; PTR64_IDX32-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
223;
224; PTR16_IDX16-LABEL: 'trunc_ptr_to_i128'
225; PTR16_IDX16-NEXT:  Classifying expressions for: @trunc_ptr_to_i128
226; PTR16_IDX16-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
227; PTR16_IDX16-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
228; PTR16_IDX16-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i128 ptrtoint ([0 x i8]* @global to i128)
229; PTR16_IDX16-NEXT:    --> ((ptrtoint [0 x i8]* @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
230; PTR16_IDX16-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
231; PTR16_IDX16-NEXT:    --> ((ptrtoint [0 x i8]* @global to i16) + %arg) U: full-set S: full-set Exits: ((ptrtoint [0 x i8]* @global to i16) + %arg) LoopDispositions: { %bb11: Invariant }
232; PTR16_IDX16-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
233; PTR16_IDX16-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
234; PTR16_IDX16-NEXT:    %tmp18 = add i32 %tmp, 2
235; PTR16_IDX16-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
236; PTR16_IDX16-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i128
237; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
238; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
239; PTR16_IDX16-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
240;
241; PTR16_IDX32-LABEL: 'trunc_ptr_to_i128'
242; PTR16_IDX32-NEXT:  Classifying expressions for: @trunc_ptr_to_i128
243; PTR16_IDX32-NEXT:    %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
244; PTR16_IDX32-NEXT:    --> {0,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
245; PTR16_IDX32-NEXT:    %tmp12 = getelementptr i8, i8* %arg, i128 ptrtoint ([0 x i8]* @global to i128)
246; PTR16_IDX32-NEXT:    --> ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) U: [0,131071) S: [0,131071) Exits: ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
247; PTR16_IDX32-NEXT:    %tmp13 = bitcast i8* %tmp12 to i32*
248; PTR16_IDX32-NEXT:    --> ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) U: [0,131071) S: [0,131071) Exits: ((trunc i128 ptrtoint ([0 x i8]* @global to i128) to i32) + %arg) LoopDispositions: { %bb11: Invariant }
249; PTR16_IDX32-NEXT:    %tmp14 = load i32, i32* %tmp13, align 4
250; PTR16_IDX32-NEXT:    --> %tmp14 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb11: Variant }
251; PTR16_IDX32-NEXT:    %tmp18 = add i32 %tmp, 2
252; PTR16_IDX32-NEXT:    --> {2,+,2}<%bb11> U: [0,-1) S: [-2147483648,2147483647) Exits: <<Unknown>> LoopDispositions: { %bb11: Computable }
253; PTR16_IDX32-NEXT:  Determining loop execution counts for: @trunc_ptr_to_i128
254; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable backedge-taken count.
255; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable max backedge-taken count.
256; PTR16_IDX32-NEXT:  Loop %bb11: Unpredictable predicated backedge-taken count.
257;
258bb:
259  br label %bb11
260
261bb11:                                             ; preds = %bb17, %bb
262  %tmp = phi i32 [ 0, %bb ], [ %tmp18, %bb17 ]
263  %tmp12 = getelementptr i8, i8* %arg, i128 ptrtoint ([0 x i8]* @global to i128)
264  %tmp13 = bitcast i8* %tmp12 to i32*
265  %tmp14 = load i32, i32* %tmp13, align 4
266  %tmp15 = icmp eq i32 %tmp14, 6
267  br i1 %tmp15, label %bb16, label %bb17
268
269bb16:                                             ; preds = %bb11
270  ret i32* %arg10
271
272bb17:                                             ; preds = %bb11
273  %tmp18 = add i32 %tmp, 2
274  br label %bb11
275}
276
277define void @zext_ptr_to_i32(i32 %arg, i32 %arg6) {
278; PTR64_IDX64-LABEL: 'zext_ptr_to_i32'
279; PTR64_IDX64-NEXT:  Classifying expressions for: @zext_ptr_to_i32
280; PTR64_IDX64-NEXT:    %tmp = sub i32 %arg, ptrtoint ([0 x i8]* @global to i32)
281; PTR64_IDX64-NEXT:    --> ((-1 * (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i32)) + %arg) U: full-set S: full-set Exits: ((-1 * (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i32)) + %arg) LoopDispositions: { %bb7: Invariant }
282; PTR64_IDX64-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
283; PTR64_IDX64-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
284; PTR64_IDX64-NEXT:  Determining loop execution counts for: @zext_ptr_to_i32
285; PTR64_IDX64-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
286; PTR64_IDX64-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
287; PTR64_IDX64-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
288;
289; PTR64_IDX32-LABEL: 'zext_ptr_to_i32'
290; PTR64_IDX32-NEXT:  Classifying expressions for: @zext_ptr_to_i32
291; PTR64_IDX32-NEXT:    %tmp = sub i32 %arg, ptrtoint ([0 x i8]* @global to i32)
292; PTR64_IDX32-NEXT:    --> ((-1 * ptrtoint ([0 x i8]* @global to i32)) + %arg) U: full-set S: full-set Exits: ((-1 * ptrtoint ([0 x i8]* @global to i32)) + %arg) LoopDispositions: { %bb7: Invariant }
293; PTR64_IDX32-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
294; PTR64_IDX32-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
295; PTR64_IDX32-NEXT:  Determining loop execution counts for: @zext_ptr_to_i32
296; PTR64_IDX32-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
297; PTR64_IDX32-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
298; PTR64_IDX32-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
299;
300; PTR16_IDX16-LABEL: 'zext_ptr_to_i32'
301; PTR16_IDX16-NEXT:  Classifying expressions for: @zext_ptr_to_i32
302; PTR16_IDX16-NEXT:    %tmp = sub i32 %arg, ptrtoint ([0 x i8]* @global to i32)
303; PTR16_IDX16-NEXT:    --> ((-1 * (zext i16 (ptrtoint [0 x i8]* @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (zext i16 (ptrtoint [0 x i8]* @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
304; PTR16_IDX16-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
305; PTR16_IDX16-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
306; PTR16_IDX16-NEXT:  Determining loop execution counts for: @zext_ptr_to_i32
307; PTR16_IDX16-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
308; PTR16_IDX16-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
309; PTR16_IDX16-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
310;
311; PTR16_IDX32-LABEL: 'zext_ptr_to_i32'
312; PTR16_IDX32-NEXT:  Classifying expressions for: @zext_ptr_to_i32
313; PTR16_IDX32-NEXT:    %tmp = sub i32 %arg, ptrtoint ([0 x i8]* @global to i32)
314; PTR16_IDX32-NEXT:    --> ((-1 * ptrtoint ([0 x i8]* @global to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * ptrtoint ([0 x i8]* @global to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
315; PTR16_IDX32-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
316; PTR16_IDX32-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
317; PTR16_IDX32-NEXT:  Determining loop execution counts for: @zext_ptr_to_i32
318; PTR16_IDX32-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
319; PTR16_IDX32-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
320; PTR16_IDX32-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
321;
322bb:
323  br label %bb7
324
325bb7:                                              ; preds = %bb7, %bb
326  %tmp = sub i32 %arg, ptrtoint ([0 x i8]* @global to i32)
327  %tmp8 = icmp eq i32 %tmp, %arg6
328  %tmp9 = select i1 %tmp8, i16 0, i16 1
329  call void @use16(i16 %tmp9)
330  br i1 %tmp8, label %bb7, label %bb10
331
332bb10:                                             ; preds = %bb7
333  ret void
334}
335
336define void @sext_to_i32(i32 %arg, i32 %arg6) {
337; PTR64_IDX64-LABEL: 'sext_to_i32'
338; PTR64_IDX64-NEXT:  Classifying expressions for: @sext_to_i32
339; PTR64_IDX64-NEXT:    %tmp = sub i32 %arg, sext (i16 ptrtoint ([0 x i8]* @global to i16) to i32)
340; PTR64_IDX64-NEXT:    --> ((-1 * (sext i16 (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 (trunc i64 (ptrtoint [0 x i8]* @global to i64) to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
341; PTR64_IDX64-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
342; PTR64_IDX64-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
343; PTR64_IDX64-NEXT:  Determining loop execution counts for: @sext_to_i32
344; PTR64_IDX64-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
345; PTR64_IDX64-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
346; PTR64_IDX64-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
347;
348; PTR64_IDX32-LABEL: 'sext_to_i32'
349; PTR64_IDX32-NEXT:  Classifying expressions for: @sext_to_i32
350; PTR64_IDX32-NEXT:    %tmp = sub i32 %arg, sext (i16 ptrtoint ([0 x i8]* @global to i16) to i32)
351; PTR64_IDX32-NEXT:    --> ((-1 * (sext i16 ptrtoint ([0 x i8]* @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 ptrtoint ([0 x i8]* @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
352; PTR64_IDX32-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
353; PTR64_IDX32-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
354; PTR64_IDX32-NEXT:  Determining loop execution counts for: @sext_to_i32
355; PTR64_IDX32-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
356; PTR64_IDX32-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
357; PTR64_IDX32-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
358;
359; PTR16_IDX16-LABEL: 'sext_to_i32'
360; PTR16_IDX16-NEXT:  Classifying expressions for: @sext_to_i32
361; PTR16_IDX16-NEXT:    %tmp = sub i32 %arg, sext (i16 ptrtoint ([0 x i8]* @global to i16) to i32)
362; PTR16_IDX16-NEXT:    --> ((-1 * (sext i16 (ptrtoint [0 x i8]* @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 (ptrtoint [0 x i8]* @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
363; PTR16_IDX16-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
364; PTR16_IDX16-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
365; PTR16_IDX16-NEXT:  Determining loop execution counts for: @sext_to_i32
366; PTR16_IDX16-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
367; PTR16_IDX16-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
368; PTR16_IDX16-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
369;
370; PTR16_IDX32-LABEL: 'sext_to_i32'
371; PTR16_IDX32-NEXT:  Classifying expressions for: @sext_to_i32
372; PTR16_IDX32-NEXT:    %tmp = sub i32 %arg, sext (i16 ptrtoint ([0 x i8]* @global to i16) to i32)
373; PTR16_IDX32-NEXT:    --> ((-1 * (sext i16 ptrtoint ([0 x i8]* @global to i16) to i32))<nsw> + %arg) U: full-set S: full-set Exits: ((-1 * (sext i16 ptrtoint ([0 x i8]* @global to i16) to i32))<nsw> + %arg) LoopDispositions: { %bb7: Invariant }
374; PTR16_IDX32-NEXT:    %tmp9 = select i1 %tmp8, i16 0, i16 1
375; PTR16_IDX32-NEXT:    --> %tmp9 U: [0,2) S: [0,2) Exits: <<Unknown>> LoopDispositions: { %bb7: Variant }
376; PTR16_IDX32-NEXT:  Determining loop execution counts for: @sext_to_i32
377; PTR16_IDX32-NEXT:  Loop %bb7: Unpredictable backedge-taken count.
378; PTR16_IDX32-NEXT:  Loop %bb7: Unpredictable max backedge-taken count.
379; PTR16_IDX32-NEXT:  Loop %bb7: Unpredictable predicated backedge-taken count.
380;
381bb:
382  br label %bb7
383
384bb7:                                              ; preds = %bb7, %bb
385  %tmp = sub i32 %arg, sext (i16 ptrtoint ([0 x i8]* @global to i16) to i32)
386  %tmp8 = icmp eq i32 %tmp, %arg6
387  %tmp9 = select i1 %tmp8, i16 0, i16 1
388  call void @use16(i16 %tmp9)
389  br i1 %tmp8, label %bb7, label %bb10
390
391bb10:                                             ; preds = %bb7
392  ret void
393}
394
395define i64 @sext_like_noop(i32 %n) {
396; PTR64_IDX64-LABEL: 'sext_like_noop'
397; PTR64_IDX64-NEXT:  Classifying expressions for: @sext_like_noop
398; PTR64_IDX64-NEXT:    %ii = sext i32 %i to i64
399; PTR64_IDX64-NEXT:    --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + (trunc i64 (ptrtoint i64 (i32)* @sext_like_noop to i64) to i32)) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648)
400; PTR64_IDX64-NEXT:    %div = sdiv i64 55555, %ii
401; PTR64_IDX64-NEXT:    --> %div U: full-set S: full-set --> sdiv (i64 55555, i64 sext (i32 add (i32 ptrtoint (i64 (i32)* @sext_like_noop to i32), i32 -1) to i64)) U: full-set S: full-set
402; PTR64_IDX64-NEXT:    %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
403; PTR64_IDX64-NEXT:    --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + (trunc i64 (ptrtoint i64 (i32)* @sext_like_noop to i64) to i32)) LoopDispositions: { %for.body: Computable }
404; PTR64_IDX64-NEXT:    %inc = add nuw i32 %i, 1
405; PTR64_IDX64-NEXT:    --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: (trunc i64 (ptrtoint i64 (i32)* @sext_like_noop to i64) to i32) LoopDispositions: { %for.body: Computable }
406; PTR64_IDX64-NEXT:  Determining loop execution counts for: @sext_like_noop
407; PTR64_IDX64-NEXT:  Loop %for.body: backedge-taken count is (-2 + (trunc i64 (ptrtoint i64 (i32)* @sext_like_noop to i64) to i32))
408; PTR64_IDX64-NEXT:  Loop %for.body: max backedge-taken count is -1
409; PTR64_IDX64-NEXT:  Loop %for.body: Predicated backedge-taken count is (-2 + (trunc i64 (ptrtoint i64 (i32)* @sext_like_noop to i64) to i32))
410; PTR64_IDX64-NEXT:   Predicates:
411; PTR64_IDX64:       Loop %for.body: Trip multiple is 1
412;
413; PTR64_IDX32-LABEL: 'sext_like_noop'
414; PTR64_IDX32-NEXT:  Classifying expressions for: @sext_like_noop
415; PTR64_IDX32-NEXT:    %ii = sext i32 %i to i64
416; PTR64_IDX32-NEXT:    --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (sext i32 (-1 + ptrtoint (i64 (i32)* @sext_like_noop to i32)) to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648)
417; PTR64_IDX32-NEXT:    %div = sdiv i64 55555, %ii
418; PTR64_IDX32-NEXT:    --> %div U: full-set S: full-set --> sdiv (i64 55555, i64 sext (i32 add (i32 ptrtoint (i64 (i32)* @sext_like_noop to i32), i32 -1) to i64)) U: full-set S: full-set
419; PTR64_IDX32-NEXT:    %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
420; PTR64_IDX32-NEXT:    --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + ptrtoint (i64 (i32)* @sext_like_noop to i32)) LoopDispositions: { %for.body: Computable }
421; PTR64_IDX32-NEXT:    %inc = add nuw i32 %i, 1
422; PTR64_IDX32-NEXT:    --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: ptrtoint (i64 (i32)* @sext_like_noop to i32) LoopDispositions: { %for.body: Computable }
423; PTR64_IDX32-NEXT:  Determining loop execution counts for: @sext_like_noop
424; PTR64_IDX32-NEXT:  Loop %for.body: backedge-taken count is (-2 + ptrtoint (i64 (i32)* @sext_like_noop to i32))
425; PTR64_IDX32-NEXT:  Loop %for.body: max backedge-taken count is -1
426; PTR64_IDX32-NEXT:  Loop %for.body: Predicated backedge-taken count is (-2 + ptrtoint (i64 (i32)* @sext_like_noop to i32))
427; PTR64_IDX32-NEXT:   Predicates:
428; PTR64_IDX32:       Loop %for.body: Trip multiple is 1
429;
430; PTR16_IDX16-LABEL: 'sext_like_noop'
431; PTR16_IDX16-NEXT:  Classifying expressions for: @sext_like_noop
432; PTR16_IDX16-NEXT:    %ii = sext i32 %i to i64
433; PTR16_IDX16-NEXT:    --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i16 (ptrtoint i64 (i32)* @sext_like_noop to i16) to i64))<nsw> U: [-1,65535) S: [-1,65535)
434; PTR16_IDX16-NEXT:    %div = sdiv i64 55555, %ii
435; PTR16_IDX16-NEXT:    --> %div U: full-set S: full-set --> sdiv (i64 55555, i64 add (i64 zext (i16 ptrtoint (i64 (i32)* @sext_like_noop to i16) to i64), i64 -1)) U: full-set S: full-set
436; PTR16_IDX16-NEXT:    %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
437; PTR16_IDX16-NEXT:    --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + (zext i16 (ptrtoint i64 (i32)* @sext_like_noop to i16) to i32))<nsw> LoopDispositions: { %for.body: Computable }
438; PTR16_IDX16-NEXT:    %inc = add nuw i32 %i, 1
439; PTR16_IDX16-NEXT:    --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: (zext i16 (ptrtoint i64 (i32)* @sext_like_noop to i16) to i32) LoopDispositions: { %for.body: Computable }
440; PTR16_IDX16-NEXT:  Determining loop execution counts for: @sext_like_noop
441; PTR16_IDX16-NEXT:  Loop %for.body: backedge-taken count is (-2 + (zext i16 (ptrtoint i64 (i32)* @sext_like_noop to i16) to i32))<nsw>
442; PTR16_IDX16-NEXT:  Loop %for.body: max backedge-taken count is -1
443; PTR16_IDX16-NEXT:  Loop %for.body: Predicated backedge-taken count is (-2 + (zext i16 (ptrtoint i64 (i32)* @sext_like_noop to i16) to i32))<nsw>
444; PTR16_IDX16-NEXT:   Predicates:
445; PTR16_IDX16:       Loop %for.body: Trip multiple is 1
446;
447; PTR16_IDX32-LABEL: 'sext_like_noop'
448; PTR16_IDX32-NEXT:  Classifying expressions for: @sext_like_noop
449; PTR16_IDX32-NEXT:    %ii = sext i32 %i to i64
450; PTR16_IDX32-NEXT:    --> (sext i32 {1,+,1}<nuw><%for.body> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) --> (-1 + (zext i32 ptrtoint (i64 (i32)* @sext_like_noop to i32) to i64))<nsw> U: [-1,65535) S: [-1,65535)
451; PTR16_IDX32-NEXT:    %div = sdiv i64 55555, %ii
452; PTR16_IDX32-NEXT:    --> %div U: full-set S: full-set --> sdiv (i64 55555, i64 add (i64 zext (i32 ptrtoint (i64 (i32)* @sext_like_noop to i32) to i64), i64 -1)) U: full-set S: full-set
453; PTR16_IDX32-NEXT:    %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
454; PTR16_IDX32-NEXT:    --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: (-1 + ptrtoint (i64 (i32)* @sext_like_noop to i32))<nsw> LoopDispositions: { %for.body: Computable }
455; PTR16_IDX32-NEXT:    %inc = add nuw i32 %i, 1
456; PTR16_IDX32-NEXT:    --> {2,+,1}<nuw><%for.body> U: [2,0) S: [2,0) Exits: ptrtoint (i64 (i32)* @sext_like_noop to i32) LoopDispositions: { %for.body: Computable }
457; PTR16_IDX32-NEXT:  Determining loop execution counts for: @sext_like_noop
458; PTR16_IDX32-NEXT:  Loop %for.body: backedge-taken count is (-2 + ptrtoint (i64 (i32)* @sext_like_noop to i32))<nsw>
459; PTR16_IDX32-NEXT:  Loop %for.body: max backedge-taken count is -1
460; PTR16_IDX32-NEXT:  Loop %for.body: Predicated backedge-taken count is (-2 + ptrtoint (i64 (i32)* @sext_like_noop to i32))<nsw>
461; PTR16_IDX32-NEXT:   Predicates:
462; PTR16_IDX32:       Loop %for.body: Trip multiple is 1
463;
464entry:
465  %cmp6 = icmp sgt i32 %n, 1
466  br label %for.body
467
468for.cond.cleanup:
469  %ii = sext i32 %i to i64
470  %div = sdiv i64 55555, %ii
471  ret i64 %div
472
473for.body:
474  %i = phi i32 [ %inc, %for.body ], [ 1, %entry ]
475  %inc = add nuw i32 %i, 1
476  %exitcond = icmp eq i32 %inc, ptrtoint (i64 (i32)* @sext_like_noop to i32)
477  br i1 %exitcond, label %for.cond.cleanup, label %for.body
478}
479declare void @f(i64)
480