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 ; OPT: %0 = type { i1, double }
25 ; OPT: %1 = type { double, float, double, double }
26 ; OPT: %2 = type { i1, i1* }
27 ; OPT: %3 = type { i64, i64 }
29 ; The automatic constant folder in opt does not have targetdata access, so
30 ; it can't fold gep arithmetic, in general. However, the constant folder run
31 ; from instcombine and global opt can use targetdata.
33 ; PLAIN: @G8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
34 ; PLAIN: @G1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
35 ; PLAIN: @F8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
36 ; PLAIN: @F1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
37 ; PLAIN: @H8 = global i8* getelementptr (i8* null, i32 -1)
38 ; PLAIN: @H1 = global i1* getelementptr (i1* null, i32 -1)
39 ; OPT: @G8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
40 ; OPT: @G1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
41 ; OPT: @F8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
42 ; OPT: @F1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
43 ; OPT: @H8 = global i8* getelementptr (i8* null, i32 -1)
44 ; OPT: @H1 = global i1* getelementptr (i1* null, i32 -1)
45 ; TO: @G8 = global i8* null
46 ; TO: @G1 = global i1* null
47 ; TO: @F8 = global i8* inttoptr (i64 -1 to i8*)
48 ; TO: @F1 = global i1* inttoptr (i64 -1 to i1*)
49 ; TO: @H8 = global i8* inttoptr (i64 -1 to i8*)
50 ; TO: @H1 = global i1* inttoptr (i64 -1 to i1*)
52 @G8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
53 @G1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
54 @F8 = global i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
55 @F1 = global i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
56 @H8 = global i8* getelementptr (i8* inttoptr (i32 0 to i8*), i32 -1)
57 @H1 = global i1* getelementptr (i1* inttoptr (i32 0 to i1*), i32 -1)
59 ; The target-independent folder should be able to do some clever
60 ; simplifications on sizeof, alignof, and offsetof expressions. The
61 ; target-dependent folder should fold these down to constants.
63 ; PLAIN: @a = constant i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310)
64 ; PLAIN: @b = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
65 ; PLAIN: @c = constant i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
66 ; PLAIN: @d = constant i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
67 ; PLAIN: @e = constant i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64)
68 ; PLAIN: @f = constant i64 1
69 ; PLAIN: @g = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
70 ; PLAIN: @h = constant i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64)
71 ; PLAIN: @i = constant i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64)
72 ; PLAIN: @j = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
73 ; PLAIN: @k = constant i64 ptrtoint (double* getelementptr (double* null, 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 ; OPT: @j = constant i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
84 ; OPT: @k = constant i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64)
85 ; TO: @a = constant i64 18480
86 ; TO: @b = constant i64 8
87 ; TO: @c = constant i64 16
88 ; TO: @d = constant i64 88
89 ; TO: @e = constant i64 16
90 ; TO: @f = constant i64 1
91 ; TO: @g = constant i64 8
92 ; TO: @h = constant i64 8
93 ; TO: @i = constant i64 8
94 ; TO: @j = constant i64 8
95 ; TO: @k = constant i64 8
97 @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))
98 @b = constant i64 ptrtoint ([13 x double]* getelementptr ({i1, [13 x double]}* null, i64 0, i32 1) to i64)
99 @c = constant i64 ptrtoint (double* getelementptr ({double, double, double, double}* null, i64 0, i32 2) to i64)
100 @d = constant i64 ptrtoint (double* getelementptr ([13 x double]* null, i64 0, i32 11) to i64)
101 @e = constant i64 ptrtoint (double* getelementptr ({double, float, double, double}* null, i64 0, i32 2) to i64)
102 @f = constant i64 ptrtoint (<{ i16, i128 }>* getelementptr ({i1, <{ i16, i128 }>}* null, i64 0, i32 1) to i64)
103 @g = constant i64 ptrtoint ({double, double}* getelementptr ({i1, {double, double}}* null, i64 0, i32 1) to i64)
104 @h = constant i64 ptrtoint (double** getelementptr (double** null, i64 1) to i64)
105 @i = constant i64 ptrtoint (double** getelementptr ({i1, double*}* null, i64 0, i32 1) to i64)
106 @j = constant i64 ptrtoint (union {double, double}* getelementptr ({i1, union {double, double}}* null, i64 0, i32 1) to i64)
107 @k = constant i64 ptrtoint (union {double, double}* getelementptr (union {double, double}* null, i64 1) to i64)
109 ; The target-dependent folder should cast GEP indices to integer-sized pointers.
111 ; PLAIN: @M = constant i64* getelementptr (i64* null, i32 1)
112 ; PLAIN: @N = constant i64* getelementptr (%3* null, i32 0, i32 1)
113 ; PLAIN: @O = constant i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
114 ; OPT: @M = constant i64* getelementptr (i64* null, i32 1)
115 ; OPT: @N = constant i64* getelementptr (%3* null, i32 0, i32 1)
116 ; OPT: @O = constant i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
117 ; TO: @M = constant i64* inttoptr (i64 8 to i64*)
118 ; TO: @N = constant i64* inttoptr (i64 8 to i64*)
119 ; TO: @O = constant i64* inttoptr (i64 8 to i64*)
121 @M = constant i64* getelementptr (i64* null, i32 1)
122 @N = constant i64* getelementptr ({ i64, i64 }* null, i32 0, i32 1)
123 @O = constant i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
125 ; Duplicate all of the above as function return values rather than
126 ; global initializers.
128 ; PLAIN: define i8* @goo8() nounwind {
129 ; PLAIN: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
132 ; PLAIN: define i1* @goo1() nounwind {
133 ; PLAIN: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
136 ; PLAIN: define i8* @foo8() nounwind {
137 ; PLAIN: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
140 ; PLAIN: define i1* @foo1() nounwind {
141 ; PLAIN: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
144 ; PLAIN: define i8* @hoo8() nounwind {
145 ; PLAIN: %t = bitcast i8* getelementptr (i8* null, i32 -1) to i8*
148 ; PLAIN: define i1* @hoo1() nounwind {
149 ; PLAIN: %t = bitcast i1* getelementptr (i1* null, i32 -1) to i1*
152 ; OPT: define i8* @goo8() nounwind {
153 ; OPT: ret i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1)
155 ; OPT: define i1* @goo1() nounwind {
156 ; OPT: ret i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1)
158 ; OPT: define i8* @foo8() nounwind {
159 ; OPT: ret i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2)
161 ; OPT: define i1* @foo1() nounwind {
162 ; OPT: ret i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2)
164 ; OPT: define i8* @hoo8() nounwind {
165 ; OPT: ret i8* getelementptr (i8* null, i32 -1)
167 ; OPT: define i1* @hoo1() nounwind {
168 ; OPT: ret i1* getelementptr (i1* null, i32 -1)
170 ; TO: define i8* @goo8() nounwind {
173 ; TO: define i1* @goo1() nounwind {
176 ; TO: define i8* @foo8() nounwind {
177 ; TO: ret i8* inttoptr (i64 -1 to i8*)
179 ; TO: define i1* @foo1() nounwind {
180 ; TO: ret i1* inttoptr (i64 -1 to i1*)
182 ; TO: define i8* @hoo8() nounwind {
183 ; TO: ret i8* inttoptr (i64 -1 to i8*)
185 ; TO: define i1* @hoo1() nounwind {
186 ; TO: ret i1* inttoptr (i64 -1 to i1*)
188 ; SCEV: Classifying expressions for: @goo8
189 ; SCEV: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
190 ; SCEV: --> ((-1 * sizeof(i8)) + inttoptr (i32 1 to i8*))
191 ; SCEV: Classifying expressions for: @goo1
192 ; SCEV: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
193 ; SCEV: --> ((-1 * sizeof(i1)) + inttoptr (i32 1 to i1*))
194 ; SCEV: Classifying expressions for: @foo8
195 ; SCEV: %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
196 ; SCEV: --> ((-2 * sizeof(i8)) + inttoptr (i32 1 to i8*))
197 ; SCEV: Classifying expressions for: @foo1
198 ; SCEV: %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
199 ; SCEV: --> ((-2 * sizeof(i1)) + inttoptr (i32 1 to i1*))
200 ; SCEV: Classifying expressions for: @hoo8
201 ; SCEV: --> (-1 * sizeof(i8))
202 ; SCEV: Classifying expressions for: @hoo1
203 ; SCEV: --> (-1 * sizeof(i1))
205 define i8* @goo8() nounwind {
206 %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -1) to i8*
209 define i1* @goo1() nounwind {
210 %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -1) to i1*
213 define i8* @foo8() nounwind {
214 %t = bitcast i8* getelementptr (i8* inttoptr (i32 1 to i8*), i32 -2) to i8*
217 define i1* @foo1() nounwind {
218 %t = bitcast i1* getelementptr (i1* inttoptr (i32 1 to i1*), i32 -2) to i1*
221 define i8* @hoo8() nounwind {
222 %t = bitcast i8* getelementptr (i8* inttoptr (i32 0 to i8*), i32 -1) to i8*
225 define i1* @hoo1() nounwind {
226 %t = bitcast i1* getelementptr (i1* inttoptr (i32 0 to i1*), i32 -1) to i1*
230 ; PLAIN: define i64 @fa() nounwind {
231 ; PLAIN: %t = bitcast i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310) to i64
234 ; PLAIN: define i64 @fb() nounwind {
235 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
238 ; PLAIN: define i64 @fc() nounwind {
239 ; PLAIN: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2) to i64
242 ; PLAIN: define i64 @fd() nounwind {
243 ; PLAIN: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11) to i64
246 ; PLAIN: define i64 @fe() nounwind {
247 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64) to i64
250 ; PLAIN: define i64 @ff() nounwind {
251 ; PLAIN: %t = bitcast i64 1 to i64
254 ; PLAIN: define i64 @fg() nounwind {
255 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
258 ; PLAIN: define i64 @fh() nounwind {
259 ; PLAIN: %t = bitcast i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64) to i64
262 ; PLAIN: define i64 @fi() nounwind {
263 ; PLAIN: %t = bitcast i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64) to i64
266 ; PLAIN: define i64 @fj() nounwind {
267 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
270 ; PLAIN: define i64 @fk() nounwind {
271 ; PLAIN: %t = bitcast i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64) to i64
274 ; OPT: define i64 @fa() nounwind {
275 ; OPT: ret i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310)
277 ; OPT: define i64 @fb() nounwind {
278 ; OPT: ret i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
280 ; OPT: define i64 @fc() nounwind {
281 ; OPT: ret i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
283 ; OPT: define i64 @fd() nounwind {
284 ; OPT: ret i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
286 ; OPT: define i64 @fe() nounwind {
287 ; OPT: ret i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64)
289 ; OPT: define i64 @ff() nounwind {
292 ; OPT: define i64 @fg() nounwind {
293 ; OPT: ret i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
295 ; OPT: define i64 @fh() nounwind {
296 ; OPT: ret i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64)
298 ; OPT: define i64 @fi() nounwind {
299 ; OPT: ret i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64)
301 ; OPT: define i64 @fj() nounwind {
302 ; OPT: ret i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64)
304 ; OPT: define i64 @fk() nounwind {
305 ; OPT: ret i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64)
307 ; TO: define i64 @fa() nounwind {
310 ; TO: define i64 @fb() nounwind {
313 ; TO: define i64 @fc() nounwind {
316 ; TO: define i64 @fd() nounwind {
319 ; TO: define i64 @fe() nounwind {
322 ; TO: define i64 @ff() nounwind {
325 ; TO: define i64 @fg() nounwind {
328 ; TO: define i64 @fh() nounwind {
331 ; TO: define i64 @fi() nounwind {
334 ; TO: define i64 @fj() nounwind {
337 ; TO: define i64 @fk() nounwind {
340 ; SCEV: Classifying expressions for: @fa
341 ; SCEV: %t = bitcast i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2310) to i64
342 ; SCEV: --> (2310 * sizeof(double))
343 ; SCEV: Classifying expressions for: @fb
344 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
345 ; SCEV: --> alignof(double)
346 ; SCEV: Classifying expressions for: @fc
347 ; SCEV: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2) to i64
348 ; SCEV: --> (2 * sizeof(double))
349 ; SCEV: Classifying expressions for: @fd
350 ; SCEV: %t = bitcast i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11) to i64
351 ; SCEV: --> (11 * sizeof(double))
352 ; SCEV: Classifying expressions for: @fe
353 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%1* null, i64 0, i32 2) to i64) to i64
354 ; SCEV: --> offsetof({ double, float, double, double }, 2)
355 ; SCEV: Classifying expressions for: @ff
356 ; SCEV: %t = bitcast i64 1 to i64
358 ; SCEV: Classifying expressions for: @fg
359 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
360 ; SCEV: --> alignof(double)
361 ; SCEV: Classifying expressions for: @fh
362 ; SCEV: %t = bitcast i64 ptrtoint (i1** getelementptr (i1** null, i32 1) to i64) to i64
363 ; SCEV: --> sizeof(i1*)
364 ; SCEV: Classifying expressions for: @fi
365 ; SCEV: %t = bitcast i64 ptrtoint (i1** getelementptr (%2* null, i64 0, i32 1) to i64) to i64
366 ; SCEV: --> alignof(i1*)
367 ; SCEV: Classifying expressions for: @fj
368 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (%0* null, i64 0, i32 1) to i64) to i64
369 ; SCEV: --> alignof(double)
370 ; SCEV: Classifying expressions for: @fk
371 ; SCEV: %t = bitcast i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64) to i64
372 ; SCEV: --> sizeof(double)
374 define i64 @fa() nounwind {
375 %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
378 define i64 @fb() nounwind {
379 %t = bitcast i64 ptrtoint ([13 x double]* getelementptr ({i1, [13 x double]}* null, i64 0, i32 1) to i64) to i64
382 define i64 @fc() nounwind {
383 %t = bitcast i64 ptrtoint (double* getelementptr ({double, double, double, double}* null, i64 0, i32 2) to i64) to i64
386 define i64 @fd() nounwind {
387 %t = bitcast i64 ptrtoint (double* getelementptr ([13 x double]* null, i64 0, i32 11) to i64) to i64
390 define i64 @fe() nounwind {
391 %t = bitcast i64 ptrtoint (double* getelementptr ({double, float, double, double}* null, i64 0, i32 2) to i64) to i64
394 define i64 @ff() nounwind {
395 %t = bitcast i64 ptrtoint (<{ i16, i128 }>* getelementptr ({i1, <{ i16, i128 }>}* null, i64 0, i32 1) to i64) to i64
398 define i64 @fg() nounwind {
399 %t = bitcast i64 ptrtoint ({double, double}* getelementptr ({i1, {double, double}}* null, i64 0, i32 1) to i64) to i64
402 define i64 @fh() nounwind {
403 %t = bitcast i64 ptrtoint (double** getelementptr (double** null, i32 1) to i64) to i64
406 define i64 @fi() nounwind {
407 %t = bitcast i64 ptrtoint (double** getelementptr ({i1, double*}* null, i64 0, i32 1) to i64) to i64
410 define i64 @fj() nounwind {
411 %t = bitcast i64 ptrtoint (union {double, double}* getelementptr ({i1, union {double, double}}* null, i64 0, i32 1) to i64) to i64
414 define i64 @fk() nounwind {
415 %t = bitcast i64 ptrtoint (union {double, double}* getelementptr (union {double, double}* null, i64 1) to i64) to i64
419 ; PLAIN: define i64* @fM() nounwind {
420 ; PLAIN: %t = bitcast i64* getelementptr (i64* null, i32 1) to i64*
423 ; PLAIN: define i64* @fN() nounwind {
424 ; PLAIN: %t = bitcast i64* getelementptr (%3* null, i32 0, i32 1) to i64*
427 ; PLAIN: define i64* @fO() nounwind {
428 ; PLAIN: %t = bitcast i64* getelementptr ([2 x i64]* null, i32 0, i32 1) to i64*
431 ; OPT: define i64* @fM() nounwind {
432 ; OPT: ret i64* getelementptr (i64* null, i32 1)
434 ; OPT: define i64* @fN() nounwind {
435 ; OPT: ret i64* getelementptr (%3* null, i32 0, i32 1)
437 ; OPT: define i64* @fO() nounwind {
438 ; OPT: ret i64* getelementptr ([2 x i64]* null, i32 0, i32 1)
440 ; TO: define i64* @fM() nounwind {
441 ; TO: ret i64* inttoptr (i64 8 to i64*)
443 ; TO: define i64* @fN() nounwind {
444 ; TO: ret i64* inttoptr (i64 8 to i64*)
446 ; TO: define i64* @fO() nounwind {
447 ; TO: ret i64* inttoptr (i64 8 to i64*)
449 ; SCEV: Classifying expressions for: @fM
450 ; SCEV: %t = bitcast i64* getelementptr (i64* null, i32 1) to i64*
451 ; SCEV: --> sizeof(i64)
452 ; SCEV: Classifying expressions for: @fN
453 ; SCEV: %t = bitcast i64* getelementptr (%3* null, i32 0, i32 1) to i64*
454 ; SCEV: --> sizeof(i64)
455 ; SCEV: Classifying expressions for: @fO
456 ; SCEV: %t = bitcast i64* getelementptr ([2 x i64]* null, i32 0, i32 1) to i64*
457 ; SCEV: --> sizeof(i64)
459 define i64* @fM() nounwind {
460 %t = bitcast i64* getelementptr (i64* null, i32 1) to i64*
463 define i64* @fN() nounwind {
464 %t = bitcast i64* getelementptr ({ i64, i64 }* null, i32 0, i32 1) to i64*
467 define i64* @fO() nounwind {
468 %t = bitcast i64* getelementptr ([2 x i64]* null, i32 0, i32 1) to i64*