1 ; "PLAIN" - No optimizations. This tests the target-independent
3 ; RUN: opt -S -o - < %s | FileCheck --check-prefix=PLAIN %s
5 ; "OPT" - Optimizations but no targetdata. This tests target-independent
6 ; folding in the optimizers.
7 ; RUN: opt -S -o - -instcombine -globalopt < %s | FileCheck --check-prefix=OPT %s
9 ; "TO" - Optimizations and targetdata. This tests target-dependent
10 ; folding in the optimizers.
11 ; RUN: opt -S -o - -instcombine -globalopt -default-data-layout="e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" < %s | FileCheck --check-prefix=TO %s
13 ; "SCEV" - ScalarEvolution but no targetdata.
14 ; RUN: opt -analyze -scalar-evolution < %s | FileCheck --check-prefix=SCEV %s
16 ; ScalarEvolution with targetdata isn't interesting on these testcases
17 ; because ScalarEvolution doesn't attempt to duplicate all of instcombine's
18 ; and the constant folders' folding.
20 ; PLAIN: %0 = type { i1, double }
21 ; PLAIN: %1 = type { double, float, double, double }
22 ; PLAIN: %2 = type { i1, i1* }
23 ; PLAIN: %3 = type { i64, i64 }
24 ; PLAIN: %4 = type { i32, i32 }
25 ; OPT: %0 = type { i1, double }
26 ; OPT: %1 = type { double, float, double, double }
27 ; OPT: %2 = type { i1, i1* }
28 ; OPT: %3 = type { i64, i64 }
29 ; OPT: %4 = type { i32, i32 }
31 ; The automatic constant folder in opt does not have targetdata access, so
32 ; it can't fold gep arithmetic, in general. However, the constant folder run
33 ; from instcombine and global opt can use targetdata.
35 ; PLAIN: @G8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
36 ; PLAIN: @G1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
37 ; PLAIN: @F8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
38 ; PLAIN: @F1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
39 ; PLAIN: @H8 = global i8* getelementptr (i8* null, i32 -1)
40 ; PLAIN: @H1 = global i1* getelementptr (i1* null, i32 -1)
41 ; OPT: @G8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
42 ; OPT: @G1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
43 ; OPT: @F8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
44 ; OPT: @F1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
45 ; OPT: @H8 = global i8* getelementptr (i8* null, i32 -1)
46 ; OPT: @H1 = global i1* getelementptr (i1* null, i32 -1)
47 ; TO: @G8 = global i8* null
48 ; TO: @G1 = global i1* null
49 ; TO: @F8 = global i8* inttoptr (i64 -1 to i8*)
50 ; TO: @F1 = global i1* inttoptr (i64 -1 to i1*)
51 ; TO: @H8 = global i8* inttoptr (i64 -1 to i8*)
52 ; TO: @H1 = global i1* inttoptr (i64 -1 to i1*)
54 @G8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
55 @G1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
56 @F8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
57 @F1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
58 @H8 = global i8* getelementptr (i8* inttoptr (i32 0 to i8*), i32 -1)
59 @H1 = global i1* getelementptr (i1* inttoptr (i32 0 to i1*), i32 -1)
61 ; The target-independent folder should be able to do some clever
62 ; simplifications on sizeof, alignof, and offsetof expressions. The
63 ; target-dependent folder should fold these down to constants.
65 ; PLAIN: @a = constant i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310)
66 ; PLAIN: @b = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
67 ; PLAIN: @c = constant i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
68 ; PLAIN: @d = constant i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
69 ; PLAIN: @e = constant i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64)
70 ; PLAIN: @f = constant i64 1
71 ; PLAIN: @g = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
72 ; PLAIN: @h = constant i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64)
73 ; PLAIN: @i = constant i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64)
74 ; OPT: @a = constant i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310)
75 ; OPT: @b = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
76 ; OPT: @c = constant i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
77 ; OPT: @d = constant i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
78 ; OPT: @e = constant i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64)
79 ; OPT: @f = constant i64 1
80 ; OPT: @g = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
81 ; OPT: @h = constant i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64)
82 ; OPT: @i = constant i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64)
83 ; TO: @a = constant i64 18480
84 ; TO: @b = constant i64 8
85 ; TO: @c = constant i64 16
86 ; TO: @d = constant i64 88
87 ; TO: @e = constant i64 16
88 ; TO: @f = constant i64 1
89 ; TO: @g = constant i64 8
90 ; TO: @h = constant i64 8
91 ; TO: @i = constant i64 8
93 @a = constant i64 mul (i64 3, i64 mul (i64 ptrtoint ({[7 x double], [7 x double]}* getelementptr ({[7 x double], [7 x double]}* null, i64 11) to i64), i64 5))
94 @b = constant i64 ptrtoint ([13 x double]* getelementptr ({i1, [13 x double]}* null, i64 0, i32 1) to i64)
95 @c = constant i64 ptrtoint (double* getelementptr ({double, double, double, double}* null, i64 0, i32 2) to i64)
96 @d = constant i64 ptrtoint (double* getelementptr ([13 x double]* null, i64 0, i32 11) to i64)
97 @e = constant i64 ptrtoint (double* getelementptr ({double, float, double, double}* null, i64 0, i32 2) to i64)
98 @f = constant i64 ptrtoint (<{ i16, i128 }>* getelementptr ({i1, <{ i16, i128 }>}* null, i64 0, i32 1) to i64)
99 @g = constant i64 ptrtoint ({double, double}* getelementptr ({i1, {double, double}}* null, i64 0, i32 1) to i64)
100 @h = constant i64 ptrtoint (double** getelementptr (double** null, i64 1) to i64)
101 @i = constant i64 ptrtoint (double** getelementptr ({i1, double*}* null, i64 0, i32 1) to i64)
103 ; The target-dependent folder should cast GEP indices to integer-sized pointers.
105 ; PLAIN: @M = constant i64* getelementptr (i64* null, i32 1)
106 ; PLAIN: @N = constant i64* getelementptr (%3* null, i32 0, i32 1)
107 ; PLAIN: @O = constant i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
108 ; OPT: @M = constant i64* getelementptr (i64* null, i32 1)
109 ; OPT: @N = constant i64* getelementptr (%3* null, i32 0, i32 1)
110 ; OPT: @O = constant i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
111 ; TO: @M = constant i64* inttoptr (i64 8 to i64*)
112 ; TO: @N = constant i64* inttoptr (i64 8 to i64*)
113 ; TO: @O = constant i64* inttoptr (i64 8 to i64*)
115 @M = constant i64* getelementptr (i64* null, i32 1)
116 @N = constant i64* getelementptr ({ i64, i64 }* null, i32 0, i32 1)
117 @O = constant i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
119 ; Fold GEP of a GEP. Theoretically some of these cases could be folded
120 ; without using targetdata, however that's not implemented yet.
122 ; PLAIN: @Z = global i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x %4]* @ext, i64 0, i64 1, i32 0), i64 1)
123 ; OPT: @Z = global i32* getelementptr (i32* getelementptr inbounds ([3 x %4]* @ext, i64 0, i64 1, i32 0), i64 1)
124 ; TO: @Z = global i32* getelementptr inbounds ([3 x %0]* @ext, i64 0, i64 1, i32 1)
126 @ext = external global [3 x { i32, i32 }]
127 @Z = global i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1)
129 ; Duplicate all of the above as function return values rather than
130 ; global initializers.
132 ; PLAIN: define i8* @goo8() nounwind {
133 ; PLAIN: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
136 ; PLAIN: define i1* @goo1() nounwind {
137 ; PLAIN: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
140 ; PLAIN: define i8* @foo8() nounwind {
141 ; PLAIN: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
144 ; PLAIN: define i1* @foo1() nounwind {
145 ; PLAIN: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
148 ; PLAIN: define i8* @hoo8() nounwind {
149 ; PLAIN: %t = bitcast i8* getelementptr (i8* null, i32 -1) to i8*
152 ; PLAIN: define i1* @hoo1() nounwind {
153 ; PLAIN: %t = bitcast i1* getelementptr (i1* null, i32 -1) to i1*
156 ; OPT: define i8* @goo8() nounwind {
157 ; OPT: ret i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
159 ; OPT: define i1* @goo1() nounwind {
160 ; OPT: ret i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
162 ; OPT: define i8* @foo8() nounwind {
163 ; OPT: ret i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
165 ; OPT: define i1* @foo1() nounwind {
166 ; OPT: ret i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
168 ; OPT: define i8* @hoo8() nounwind {
169 ; OPT: ret i8* getelementptr (i8* null, i32 -1)
171 ; OPT: define i1* @hoo1() nounwind {
172 ; OPT: ret i1* getelementptr (i1* null, i32 -1)
174 ; TO: define i8* @goo8() nounwind {
177 ; TO: define i1* @goo1() nounwind {
180 ; TO: define i8* @foo8() nounwind {
181 ; TO: ret i8* inttoptr (i64 -1 to i8*)
183 ; TO: define i1* @foo1() nounwind {
184 ; TO: ret i1* inttoptr (i64 -1 to i1*)
186 ; TO: define i8* @hoo8() nounwind {
187 ; TO: ret i8* inttoptr (i64 -1 to i8*)
189 ; TO: define i1* @hoo1() nounwind {
190 ; TO: ret i1* inttoptr (i64 -1 to i1*)
192 ; SCEV: Classifying expressions for: @goo8
193 ; SCEV: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
194 ; SCEV: --> ((-1 * sizeof(i8)) + inttoptr (i32 1 to i8*))
195 ; SCEV: Classifying expressions for: @goo1
196 ; SCEV: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
197 ; SCEV: --> ((-1 * sizeof(i1)) + inttoptr (i32 1 to i1*))
198 ; SCEV: Classifying expressions for: @foo8
199 ; SCEV: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
200 ; SCEV: --> ((-2 * sizeof(i8)) + inttoptr (i32 1 to i8*))
201 ; SCEV: Classifying expressions for: @foo1
202 ; SCEV: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
203 ; SCEV: --> ((-2 * sizeof(i1)) + inttoptr (i32 1 to i1*))
204 ; SCEV: Classifying expressions for: @hoo8
205 ; SCEV: --> (-1 * sizeof(i8))
206 ; SCEV: Classifying expressions for: @hoo1
207 ; SCEV: --> (-1 * sizeof(i1))
209 define i8* @goo8() nounwind {
210 %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
213 define i1* @goo1() nounwind {
214 %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
217 define i8* @foo8() nounwind {
218 %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
221 define i1* @foo1() nounwind {
222 %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
225 define i8* @hoo8() nounwind {
226 %t = bitcast i8* getelementptr (i8* inttoptr (i32 0 to i8*), i32 -1) to i8*
229 define i1* @hoo1() nounwind {
230 %t = bitcast i1* getelementptr (i1* inttoptr (i32 0 to i1*), i32 -1) to i1*
234 ; PLAIN: define i64 @fa() nounwind {
235 ; PLAIN: %t = bitcast i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310) to i64
238 ; PLAIN: define i64 @fb() nounwind {
239 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
242 ; PLAIN: define i64 @fc() nounwind {
243 ; PLAIN: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2) to i64
246 ; PLAIN: define i64 @fd() nounwind {
247 ; PLAIN: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11) to i64
250 ; PLAIN: define i64 @fe() nounwind {
251 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64) to i64
254 ; PLAIN: define i64 @ff() nounwind {
255 ; PLAIN: %t = bitcast i64 1 to i64
258 ; PLAIN: define i64 @fg() nounwind {
259 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
262 ; PLAIN: define i64 @fh() nounwind {
263 ; PLAIN: %t = bitcast i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64) to i64
266 ; PLAIN: define i64 @fi() nounwind {
267 ; PLAIN: %t = bitcast i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64) to i64
270 ; OPT: define i64 @fa() nounwind {
271 ; OPT: ret i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310)
273 ; OPT: define i64 @fb() nounwind {
274 ; OPT: ret i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
276 ; OPT: define i64 @fc() nounwind {
277 ; OPT: ret i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
279 ; OPT: define i64 @fd() nounwind {
280 ; OPT: ret i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
282 ; OPT: define i64 @fe() nounwind {
283 ; OPT: ret i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64)
285 ; OPT: define i64 @ff() nounwind {
288 ; OPT: define i64 @fg() nounwind {
289 ; OPT: ret i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
291 ; OPT: define i64 @fh() nounwind {
292 ; OPT: ret i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64)
294 ; OPT: define i64 @fi() nounwind {
295 ; OPT: ret i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64)
297 ; TO: define i64 @fa() nounwind {
300 ; TO: define i64 @fb() nounwind {
303 ; TO: define i64 @fc() nounwind {
306 ; TO: define i64 @fd() nounwind {
309 ; TO: define i64 @fe() nounwind {
312 ; TO: define i64 @ff() nounwind {
315 ; TO: define i64 @fg() nounwind {
318 ; TO: define i64 @fh() nounwind {
321 ; TO: define i64 @fi() nounwind {
324 ; SCEV: Classifying expressions for: @fa
325 ; SCEV: %t = bitcast i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310) to i64
326 ; SCEV: --> (2310 * sizeof(double))
327 ; SCEV: Classifying expressions for: @fb
328 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
329 ; SCEV: --> alignof(double)
330 ; SCEV: Classifying expressions for: @fc
331 ; SCEV: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2) to i64
332 ; SCEV: --> (2 * sizeof(double))
333 ; SCEV: Classifying expressions for: @fd
334 ; SCEV: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11) to i64
335 ; SCEV: --> (11 * sizeof(double))
336 ; SCEV: Classifying expressions for: @fe
337 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64) to i64
338 ; SCEV: --> offsetof({ double, float, double, double }, 2)
339 ; SCEV: Classifying expressions for: @ff
340 ; SCEV: %t = bitcast i64 1 to i64
342 ; SCEV: Classifying expressions for: @fg
343 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
344 ; SCEV: --> alignof(double)
345 ; SCEV: Classifying expressions for: @fh
346 ; SCEV: %t = bitcast i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64) to i64
347 ; SCEV: --> sizeof(i1*)
348 ; SCEV: Classifying expressions for: @fi
349 ; SCEV: %t = bitcast i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64) to i64
350 ; SCEV: --> alignof(i1*)
352 define i64 @fa() nounwind {
353 %t = bitcast i64 mul (i64 3, i64 mul (i64 ptrtoint ({[7 x double], [7 x double]}* getelementptr ({[7 x double], [7 x double]}* null, i64 11) to i64), i64 5)) to i64
356 define i64 @fb() nounwind {
357 %t = bitcast i64 ptrtoint ([13 x double]* getelementptr ({i1, [13 x double]}* null, i64 0, i32 1) to i64) to i64
360 define i64 @fc() nounwind {
361 %t = bitcast i64 ptrtoint (double* getelementptr ({double, double, double, double}* null, i64 0, i32 2) to i64) to i64
364 define i64 @fd() nounwind {
365 %t = bitcast i64 ptrtoint (double* getelementptr ([13 x double]* null, i64 0, i32 11) to i64) to i64
368 define i64 @fe() nounwind {
369 %t = bitcast i64 ptrtoint (double* getelementptr ({double, float, double, double}* null, i64 0, i32 2) to i64) to i64
372 define i64 @ff() nounwind {
373 %t = bitcast i64 ptrtoint (<{ i16, i128 }>* getelementptr ({i1, <{ i16, i128 }>}* null, i64 0, i32 1) to i64) to i64
376 define i64 @fg() nounwind {
377 %t = bitcast i64 ptrtoint ({double, double}* getelementptr ({i1, {double, double}}* null, i64 0, i32 1) to i64) to i64
380 define i64 @fh() nounwind {
381 %t = bitcast i64 ptrtoint (double** getelementptr (double** null, i32 1) to i64) to i64
384 define i64 @fi() nounwind {
385 %t = bitcast i64 ptrtoint (double** getelementptr ({i1, double*}* null, i64 0, i32 1) to i64) to i64
389 ; PLAIN: define i64* @fM() nounwind {
390 ; PLAIN: %t = bitcast i64* getelementptr (i64* null, i32 1) to i64*
393 ; PLAIN: define i64* @fN() nounwind {
394 ; PLAIN: %t = bitcast i64* getelementptr (%3* null, i32 0, i32 1) to i64*
397 ; PLAIN: define i64* @fO() nounwind {
398 ; PLAIN: %t = bitcast i64* getelementptr ([2 x i64]* null, i32 0, i32 1) to i64*
401 ; OPT: define i64* @fM() nounwind {
402 ; OPT: ret i64* getelementptr (i64* null, i32 1)
404 ; OPT: define i64* @fN() nounwind {
405 ; OPT: ret i64* getelementptr (%3* null, i32 0, i32 1)
407 ; OPT: define i64* @fO() nounwind {
408 ; OPT: ret i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
410 ; TO: define i64* @fM() nounwind {
411 ; TO: ret i64* inttoptr (i64 8 to i64*)
413 ; TO: define i64* @fN() nounwind {
414 ; TO: ret i64* inttoptr (i64 8 to i64*)
416 ; TO: define i64* @fO() nounwind {
417 ; TO: ret i64* inttoptr (i64 8 to i64*)
419 ; SCEV: Classifying expressions for: @fM
420 ; SCEV: %t = bitcast i64* getelementptr (i64* null, i32 1) to i64*
421 ; SCEV: --> sizeof(i64)
422 ; SCEV: Classifying expressions for: @fN
423 ; SCEV: %t = bitcast i64* getelementptr (%3* null, i32 0, i32 1) to i64*
424 ; SCEV: --> sizeof(i64)
425 ; SCEV: Classifying expressions for: @fO
426 ; SCEV: %t = bitcast i64* getelementptr ([2 x i64]* null, i32 0, i32 1) to i64*
427 ; SCEV: --> sizeof(i64)
429 define i64* @fM() nounwind {
430 %t = bitcast i64* getelementptr (i64* null, i32 1) to i64*
433 define i64* @fN() nounwind {
434 %t = bitcast i64* getelementptr ({ i64, i64 }* null, i32 0, i32 1) to i64*
437 define i64* @fO() nounwind {
438 %t = bitcast i64* getelementptr ([2 x i64]* null, i32 0, i32 1) to i64*
442 ; PLAIN: define i32* @fZ() nounwind {
443 ; PLAIN: %t = bitcast i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x %4]* @ext, i64 0, i64 1, i32 0), i64 1) to i32*
446 ; OPT: define i32* @fZ() nounwind {
447 ; OPT: ret i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x %4]* @ext, i64 0, i64 1, i32 0), i64 1)
449 ; TO: define i32* @fZ() nounwind {
450 ; TO: ret i32* getelementptr inbounds ([3 x %0]* @ext, i64 0, i64 1, i32 1)
452 ; SCEV: Classifying expressions for: @fZ
453 ; SCEV: %t = bitcast i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x %4]* @ext, i64 0, i64 1, i32 0), i64 1) to i32*
454 ; SCEV: --> ((3 * sizeof(i32)) + @ext)
456 define i32* @fZ() nounwind {
457 %t = bitcast i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1) to i32*