Resurrect r191017 " GVN proceeds in the presence of dead code" plus a fix to PR17307...
[oota-llvm.git] / test / Transforms / GVN / rle.ll
1 ; RUN: opt < %s -default-data-layout="e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -basicaa -gvn -S -die | FileCheck %s
2 ; RUN: opt < %s -default-data-layout="E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-n32"      -basicaa -gvn -S -die | FileCheck %s
3
4 ;; Trivial RLE test.
5 define i32 @test0(i32 %V, i32* %P) {
6   store i32 %V, i32* %P
7
8   %A = load i32* %P
9   ret i32 %A
10 ; CHECK-LABEL: @test0(
11 ; CHECK: ret i32 %V
12 }
13
14
15 ;;===----------------------------------------------------------------------===;;
16 ;; Tests for crashers
17 ;;===----------------------------------------------------------------------===;;
18
19 ;; PR5016
20 define i8 @crash0({i32, i32} %A, {i32, i32}* %P) {
21   store {i32, i32} %A, {i32, i32}* %P
22   %X = bitcast {i32, i32}* %P to i8*
23   %Y = load i8* %X
24   ret i8 %Y
25 }
26
27 ;; No PR filed, crashed in CaptureTracker.
28 declare void @helper()
29 define void @crash1() {
30   tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* undef, i64 undef, i32 1, i1 false) nounwind
31   %tmp = load i8* bitcast (void ()* @helper to i8*)
32   %x = icmp eq i8 %tmp, 15
33   ret void
34 }
35
36
37 ;;===----------------------------------------------------------------------===;;
38 ;; Store -> Load  and  Load -> Load forwarding where src and dst are different
39 ;; types, but where the base pointer is a must alias.
40 ;;===----------------------------------------------------------------------===;;
41
42 ;; i32 -> f32 forwarding.
43 define float @coerce_mustalias1(i32 %V, i32* %P) {
44   store i32 %V, i32* %P
45    
46   %P2 = bitcast i32* %P to float*
47
48   %A = load float* %P2
49   ret float %A
50 ; CHECK-LABEL: @coerce_mustalias1(
51 ; CHECK-NOT: load
52 ; CHECK: ret float 
53 }
54
55 ;; i32* -> float forwarding.
56 define float @coerce_mustalias2(i32* %V, i32** %P) {
57   store i32* %V, i32** %P
58    
59   %P2 = bitcast i32** %P to float*
60
61   %A = load float* %P2
62   ret float %A
63 ; CHECK-LABEL: @coerce_mustalias2(
64 ; CHECK-NOT: load
65 ; CHECK: ret float 
66 }
67
68 ;; float -> i32* forwarding.
69 define i32* @coerce_mustalias3(float %V, float* %P) {
70   store float %V, float* %P
71    
72   %P2 = bitcast float* %P to i32**
73
74   %A = load i32** %P2
75   ret i32* %A
76 ; CHECK-LABEL: @coerce_mustalias3(
77 ; CHECK-NOT: load
78 ; CHECK: ret i32* 
79 }
80
81 ;; i32 -> f32 load forwarding.
82 define float @coerce_mustalias4(i32* %P, i1 %cond) {
83   %A = load i32* %P
84   
85   %P2 = bitcast i32* %P to float*
86   %B = load float* %P2
87   br i1 %cond, label %T, label %F
88 T:
89   ret float %B
90   
91 F:
92   %X = bitcast i32 %A to float
93   ret float %X
94
95 ; CHECK-LABEL: @coerce_mustalias4(
96 ; CHECK: %A = load i32* %P
97 ; CHECK-NOT: load
98 ; CHECK: ret float
99 ; CHECK: F:
100 }
101
102 ;; i32 -> i8 forwarding
103 define i8 @coerce_mustalias5(i32 %V, i32* %P) {
104   store i32 %V, i32* %P
105    
106   %P2 = bitcast i32* %P to i8*
107
108   %A = load i8* %P2
109   ret i8 %A
110 ; CHECK-LABEL: @coerce_mustalias5(
111 ; CHECK-NOT: load
112 ; CHECK: ret i8
113 }
114
115 ;; i64 -> float forwarding
116 define float @coerce_mustalias6(i64 %V, i64* %P) {
117   store i64 %V, i64* %P
118    
119   %P2 = bitcast i64* %P to float*
120
121   %A = load float* %P2
122   ret float %A
123 ; CHECK-LABEL: @coerce_mustalias6(
124 ; CHECK-NOT: load
125 ; CHECK: ret float
126 }
127
128 ;; i64 -> i8* (32-bit) forwarding
129 define i8* @coerce_mustalias7(i64 %V, i64* %P) {
130   store i64 %V, i64* %P
131    
132   %P2 = bitcast i64* %P to i8**
133
134   %A = load i8** %P2
135   ret i8* %A
136 ; CHECK-LABEL: @coerce_mustalias7(
137 ; CHECK-NOT: load
138 ; CHECK: ret i8*
139 }
140
141 ; memset -> i16 forwarding.
142 define signext i16 @memset_to_i16_local(i16* %A) nounwind ssp {
143 entry:
144   %conv = bitcast i16* %A to i8* 
145   tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 1, i64 200, i32 1, i1 false)
146   %arrayidx = getelementptr inbounds i16* %A, i64 42
147   %tmp2 = load i16* %arrayidx
148   ret i16 %tmp2
149 ; CHECK-LABEL: @memset_to_i16_local(
150 ; CHECK-NOT: load
151 ; CHECK: ret i16 257
152 }
153
154 ; memset -> float forwarding.
155 define float @memset_to_float_local(float* %A, i8 %Val) nounwind ssp {
156 entry:
157   %conv = bitcast float* %A to i8*                ; <i8*> [#uses=1]
158   tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 %Val, i64 400, i32 1, i1 false)
159   %arrayidx = getelementptr inbounds float* %A, i64 42 ; <float*> [#uses=1]
160   %tmp2 = load float* %arrayidx                   ; <float> [#uses=1]
161   ret float %tmp2
162 ; CHECK-LABEL: @memset_to_float_local(
163 ; CHECK-NOT: load
164 ; CHECK: zext
165 ; CHECK-NEXT: shl
166 ; CHECK-NEXT: or
167 ; CHECK-NEXT: shl
168 ; CHECK-NEXT: or
169 ; CHECK-NEXT: bitcast
170 ; CHECK-NEXT: ret float
171 }
172
173 ;; non-local memset -> i16 load forwarding.
174 define i16 @memset_to_i16_nonlocal0(i16* %P, i1 %cond) {
175   %P3 = bitcast i16* %P to i8*
176   br i1 %cond, label %T, label %F
177 T:
178   tail call void @llvm.memset.p0i8.i64(i8* %P3, i8 1, i64 400, i32 1, i1 false)
179   br label %Cont
180   
181 F:
182   tail call void @llvm.memset.p0i8.i64(i8* %P3, i8 2, i64 400, i32 1, i1 false)
183   br label %Cont
184
185 Cont:
186   %P2 = getelementptr i16* %P, i32 4
187   %A = load i16* %P2
188   ret i16 %A
189
190 ; CHECK-LABEL: @memset_to_i16_nonlocal0(
191 ; CHECK: Cont:
192 ; CHECK-NEXT:   %A = phi i16 [ 514, %F ], [ 257, %T ]
193 ; CHECK-NOT: load
194 ; CHECK: ret i16 %A
195 }
196
197 @GCst = constant {i32, float, i32 } { i32 42, float 14., i32 97 }
198
199 ; memset -> float forwarding.
200 define float @memcpy_to_float_local(float* %A) nounwind ssp {
201 entry:
202   %conv = bitcast float* %A to i8*                ; <i8*> [#uses=1]
203   tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %conv, i8* bitcast ({i32, float, i32 }* @GCst to i8*), i64 12, i32 1, i1 false)
204   %arrayidx = getelementptr inbounds float* %A, i64 1 ; <float*> [#uses=1]
205   %tmp2 = load float* %arrayidx                   ; <float> [#uses=1]
206   ret float %tmp2
207 ; CHECK-LABEL: @memcpy_to_float_local(
208 ; CHECK-NOT: load
209 ; CHECK: ret float 1.400000e+01
210 }
211
212
213
214 ;; non-local i32/float -> i8 load forwarding.
215 define i8 @coerce_mustalias_nonlocal0(i32* %P, i1 %cond) {
216   %P2 = bitcast i32* %P to float*
217   %P3 = bitcast i32* %P to i8*
218   br i1 %cond, label %T, label %F
219 T:
220   store i32 42, i32* %P
221   br label %Cont
222   
223 F:
224   store float 1.0, float* %P2
225   br label %Cont
226
227 Cont:
228   %A = load i8* %P3
229   ret i8 %A
230
231 ; CHECK-LABEL: @coerce_mustalias_nonlocal0(
232 ; CHECK: Cont:
233 ; CHECK:   %A = phi i8 [
234 ; CHECK-NOT: load
235 ; CHECK: ret i8 %A
236 }
237
238
239 ;; non-local i32/float -> i8 load forwarding.  This also tests that the "P3"
240 ;; bitcast equivalence can be properly phi translated.
241 define i8 @coerce_mustalias_nonlocal1(i32* %P, i1 %cond) {
242   %P2 = bitcast i32* %P to float*
243   br i1 %cond, label %T, label %F
244 T:
245   store i32 42, i32* %P
246   br label %Cont
247   
248 F:
249   store float 1.0, float* %P2
250   br label %Cont
251
252 Cont:
253   %P3 = bitcast i32* %P to i8*
254   %A = load i8* %P3
255   ret i8 %A
256
257 ; CHECK-LABEL: @coerce_mustalias_nonlocal1(
258 ; CHECK: Cont:
259 ; CHECK:   %A = phi i8 [
260 ; CHECK-NOT: load
261 ; CHECK: ret i8 %A
262 }
263
264
265 ;; non-local i32 -> i8 partial redundancy load forwarding.
266 define i8 @coerce_mustalias_pre0(i32* %P, i1 %cond) {
267   %P3 = bitcast i32* %P to i8*
268   br i1 %cond, label %T, label %F
269 T:
270   store i32 42, i32* %P
271   br label %Cont
272   
273 F:
274   br label %Cont
275
276 Cont:
277   %A = load i8* %P3
278   ret i8 %A
279
280 ; CHECK-LABEL: @coerce_mustalias_pre0(
281 ; CHECK: F:
282 ; CHECK:   load i8* %P3
283 ; CHECK: Cont:
284 ; CHECK:   %A = phi i8 [
285 ; CHECK-NOT: load
286 ; CHECK: ret i8 %A
287 }
288
289 ;;===----------------------------------------------------------------------===;;
290 ;; Store -> Load  and  Load -> Load forwarding where src and dst are different
291 ;; types, and the reload is an offset from the store pointer.
292 ;;===----------------------------------------------------------------------===;;
293
294 ;; i32 -> i8 forwarding.
295 ;; PR4216
296 define i8 @coerce_offset0(i32 %V, i32* %P) {
297   store i32 %V, i32* %P
298    
299   %P2 = bitcast i32* %P to i8*
300   %P3 = getelementptr i8* %P2, i32 2
301
302   %A = load i8* %P3
303   ret i8 %A
304 ; CHECK-LABEL: @coerce_offset0(
305 ; CHECK-NOT: load
306 ; CHECK: ret i8
307 }
308
309 ;; non-local i32/float -> i8 load forwarding.
310 define i8 @coerce_offset_nonlocal0(i32* %P, i1 %cond) {
311   %P2 = bitcast i32* %P to float*
312   %P3 = bitcast i32* %P to i8*
313   %P4 = getelementptr i8* %P3, i32 2
314   br i1 %cond, label %T, label %F
315 T:
316   store i32 57005, i32* %P
317   br label %Cont
318   
319 F:
320   store float 1.0, float* %P2
321   br label %Cont
322
323 Cont:
324   %A = load i8* %P4
325   ret i8 %A
326
327 ; CHECK-LABEL: @coerce_offset_nonlocal0(
328 ; CHECK: Cont:
329 ; CHECK:   %A = phi i8 [
330 ; CHECK-NOT: load
331 ; CHECK: ret i8 %A
332 }
333
334
335 ;; non-local i32 -> i8 partial redundancy load forwarding.
336 define i8 @coerce_offset_pre0(i32* %P, i1 %cond) {
337   %P3 = bitcast i32* %P to i8*
338   %P4 = getelementptr i8* %P3, i32 2
339   br i1 %cond, label %T, label %F
340 T:
341   store i32 42, i32* %P
342   br label %Cont
343   
344 F:
345   br label %Cont
346
347 Cont:
348   %A = load i8* %P4
349   ret i8 %A
350
351 ; CHECK-LABEL: @coerce_offset_pre0(
352 ; CHECK: F:
353 ; CHECK:   load i8* %P4
354 ; CHECK: Cont:
355 ; CHECK:   %A = phi i8 [
356 ; CHECK-NOT: load
357 ; CHECK: ret i8 %A
358 }
359
360 define i32 @chained_load(i32** %p, i32 %x, i32 %y) {
361 block1:
362   %A = alloca i32*
363
364   %z = load i32** %p
365   store i32* %z, i32** %A
366   %cmp = icmp eq i32 %x, %y
367   br i1 %cmp, label %block2, label %block3
368
369 block2:
370  %a = load i32** %p
371  br label %block4
372
373 block3:
374   %b = load i32** %p
375   br label %block4
376
377 block4:
378   %c = load i32** %p
379   %d = load i32* %c
380   ret i32 %d
381   
382 ; CHECK-LABEL: @chained_load(
383 ; CHECK: %z = load i32** %p
384 ; CHECK-NOT: load
385 ; CHECK: %d = load i32* %z
386 ; CHECK-NEXT: ret i32 %d
387 }
388
389
390 declare i1 @cond() readonly
391 declare i1 @cond2() readonly
392
393 define i32 @phi_trans2() {
394 ; CHECK-LABEL: @phi_trans2(
395 entry:
396   %P = alloca i32, i32 400
397   br label %F1
398   
399 F1:
400   %A = phi i32 [1, %entry], [2, %F]
401   %cond2 = call i1 @cond()
402   br i1 %cond2, label %T1, label %TY
403   
404 T1:
405   %P2 = getelementptr i32* %P, i32 %A
406   %x = load i32* %P2
407   %cond = call i1 @cond2()
408   br i1 %cond, label %TX, label %F
409   
410 F:
411   %P3 = getelementptr i32* %P, i32 2
412   store i32 17, i32* %P3
413   
414   store i32 42, i32* %P2  ; Provides "P[A]".
415   br label %F1
416
417 TX:
418   ; This load should not be compiled to 'ret i32 42'.  An overly clever
419   ; implementation of GVN would see that we're returning 17 if the loop
420   ; executes once or 42 if it executes more than that, but we'd have to do
421   ; loop restructuring to expose this, and GVN shouldn't do this sort of CFG
422   ; transformation.
423   
424 ; CHECK: TX:
425 ; CHECK: ret i32 %x
426   ret i32 %x
427 TY:
428   ret i32 0
429 }
430
431 define i32 @phi_trans3(i32* %p, i32 %x, i32 %y, i32 %z) {
432 ; CHECK-LABEL: @phi_trans3(
433 block1:
434   %cmpxy = icmp eq i32 %x, %y
435   br i1 %cmpxy, label %block2, label %block3
436
437 block2:
438  store i32 87, i32* %p
439  br label %block4
440
441 block3:
442   %p2 = getelementptr i32* %p, i32 43
443   store i32 97, i32* %p2
444   br label %block4
445
446 block4:
447   %A = phi i32 [-1, %block2], [42, %block3]
448   br i1 %cmpxy, label %block5, label %exit
449   
450 ; CHECK: block4:
451 ; CHECK-NEXT: %D = phi i32 [ 87, %block2 ], [ 97, %block3 ]  
452 ; CHECK-NOT: load
453
454 block5:
455   %B = add i32 %A, 1
456   br i1 %cmpxy, label %block6, label %exit
457   
458 block6:
459   %C = getelementptr i32* %p, i32 %B
460   br i1 %cmpxy, label %block7, label %exit
461   
462 block7:
463   %D = load i32* %C
464   ret i32 %D
465   
466 ; CHECK: block7:
467 ; CHECK-NEXT: ret i32 %D
468
469 exit:
470   ret i32 -1
471 }
472
473 define i8 @phi_trans4(i8* %p) {
474 ; CHECK-LABEL: @phi_trans4(
475 entry:
476   %X3 = getelementptr i8* %p, i32 192
477   store i8 192, i8* %X3
478   
479   %X = getelementptr i8* %p, i32 4
480   %Y = load i8* %X
481   br label %loop
482
483 loop:
484   %i = phi i32 [4, %entry], [192, %loop]
485   %X2 = getelementptr i8* %p, i32 %i
486   %Y2 = load i8* %X2
487   
488 ; CHECK: loop:
489 ; CHECK-NEXT: %Y2 = phi i8 [ %Y, %entry ], [ 0, %loop ]
490 ; CHECK-NOT: load i8
491   
492   %cond = call i1 @cond2()
493
494   %Z = bitcast i8 *%X3 to i32*
495   store i32 0, i32* %Z
496   br i1 %cond, label %loop, label %out
497   
498 out:
499   %R = add i8 %Y, %Y2
500   ret i8 %R
501 }
502
503 define i8 @phi_trans5(i8* %p) {
504 ; CHECK-LABEL: @phi_trans5(
505 entry:
506   
507   %X4 = getelementptr i8* %p, i32 2
508   store i8 19, i8* %X4
509   
510   %X = getelementptr i8* %p, i32 4
511   %Y = load i8* %X
512   br label %loop
513
514 loop:
515   %i = phi i32 [4, %entry], [3, %cont]
516   %X2 = getelementptr i8* %p, i32 %i
517   %Y2 = load i8* %X2  ; Ensure this load is not being incorrectly replaced.
518   %cond = call i1 @cond2()
519   br i1 %cond, label %cont, label %out
520
521 cont:
522   %Z = getelementptr i8* %X2, i32 -1
523   %Z2 = bitcast i8 *%Z to i32*
524   store i32 50462976, i32* %Z2  ;; (1 << 8) | (2 << 16) | (3 << 24)
525
526
527 ; CHECK: store i32
528 ; CHECK-NEXT: getelementptr i8* %p, i32 3
529 ; CHECK-NEXT: load i8*
530   br label %loop
531   
532 out:
533   %R = add i8 %Y, %Y2
534   ret i8 %R
535 }
536
537
538 ; PR6642
539 define i32 @memset_to_load() nounwind readnone {
540 entry:
541   %x = alloca [256 x i32], align 4                ; <[256 x i32]*> [#uses=2]
542   %tmp = bitcast [256 x i32]* %x to i8*           ; <i8*> [#uses=1]
543   call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 1024, i32 4, i1 false)
544   %arraydecay = getelementptr inbounds [256 x i32]* %x, i32 0, i32 0 ; <i32*>
545   %tmp1 = load i32* %arraydecay                   ; <i32> [#uses=1]
546   ret i32 %tmp1
547 ; CHECK-LABEL: @memset_to_load(
548 ; CHECK: ret i32 0
549 }
550
551
552 ;;===----------------------------------------------------------------------===;;
553 ;; Load -> Load forwarding in partial alias case.
554 ;;===----------------------------------------------------------------------===;;
555
556 define i32 @load_load_partial_alias(i8* %P) nounwind ssp {
557 entry:
558   %0 = bitcast i8* %P to i32*
559   %tmp2 = load i32* %0
560   %add.ptr = getelementptr inbounds i8* %P, i64 1
561   %tmp5 = load i8* %add.ptr
562   %conv = zext i8 %tmp5 to i32
563   %add = add nsw i32 %tmp2, %conv
564   ret i32 %add
565
566 ; TEMPORARILYDISABLED-LABEL: @load_load_partial_alias(
567 ; TEMPORARILYDISABLED: load i32*
568 ; TEMPORARILYDISABLED-NOT: load
569 ; TEMPORARILYDISABLED: lshr i32 {{.*}}, 8
570 ; TEMPORARILYDISABLED-NOT: load
571 ; TEMPORARILYDISABLED: trunc i32 {{.*}} to i8
572 ; TEMPORARILYDISABLED-NOT: load
573 ; TEMPORARILYDISABLED: ret i32
574 }
575
576
577 ; Cross block partial alias case.
578 define i32 @load_load_partial_alias_cross_block(i8* %P) nounwind ssp {
579 entry:
580   %xx = bitcast i8* %P to i32*
581   %x1 = load i32* %xx, align 4
582   %cmp = icmp eq i32 %x1, 127
583   br i1 %cmp, label %land.lhs.true, label %if.end
584
585 land.lhs.true:                                    ; preds = %entry
586   %arrayidx4 = getelementptr inbounds i8* %P, i64 1
587   %tmp5 = load i8* %arrayidx4, align 1
588   %conv6 = zext i8 %tmp5 to i32
589   ret i32 %conv6
590
591 if.end:
592   ret i32 52
593 ; TEMPORARILY_DISABLED-LABEL: @load_load_partial_alias_cross_block(
594 ; TEMPORARILY_DISABLED: land.lhs.true:
595 ; TEMPORARILY_DISABLED-NOT: load i8
596 ; TEMPORARILY_DISABLED: ret i32 %conv6
597 }
598
599
600 ;;===----------------------------------------------------------------------===;;
601 ;; Load Widening
602 ;;===----------------------------------------------------------------------===;;
603
604 %widening1 = type { i32, i8, i8, i8, i8 }
605
606 @f = global %widening1 zeroinitializer, align 4
607
608 define i32 @test_widening1(i8* %P) nounwind ssp noredzone {
609 entry:
610   %tmp = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 1), align 4
611   %conv = zext i8 %tmp to i32
612   %tmp1 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 2), align 1
613   %conv2 = zext i8 %tmp1 to i32
614   %add = add nsw i32 %conv, %conv2
615   ret i32 %add
616 ; CHECK-LABEL: @test_widening1(
617 ; CHECK-NOT: load
618 ; CHECK: load i16*
619 ; CHECK-NOT: load
620 ; CHECK: ret i32
621 }
622
623 define i32 @test_widening2() nounwind ssp noredzone {
624 entry:
625   %tmp = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 1), align 4
626   %conv = zext i8 %tmp to i32
627   %tmp1 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 2), align 1
628   %conv2 = zext i8 %tmp1 to i32
629   %add = add nsw i32 %conv, %conv2
630
631   %tmp2 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 3), align 2
632   %conv3 = zext i8 %tmp2 to i32
633   %add2 = add nsw i32 %add, %conv3
634
635   %tmp3 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 4), align 1
636   %conv4 = zext i8 %tmp3 to i32
637   %add3 = add nsw i32 %add2, %conv3
638
639   ret i32 %add3
640 ; CHECK-LABEL: @test_widening2(
641 ; CHECK-NOT: load
642 ; CHECK: load i32*
643 ; CHECK-NOT: load
644 ; CHECK: ret i32
645 }
646
647 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
648
649 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
650
651 ;;===----------------------------------------------------------------------===;;
652 ;; Load -> Store dependency which isn't interfered with by a call that happens
653 ;; before the pointer was captured.
654 ;;===----------------------------------------------------------------------===;;
655
656 %class.X = type { [8 x i8] }
657
658 @_ZTV1X = weak_odr constant [5 x i8*] zeroinitializer
659 @_ZTV1Y = weak_odr constant [5 x i8*] zeroinitializer
660
661 declare void @use()
662 declare void @use3(i8***, i8**)
663
664 ; PR8908
665 define void @test_escape1() nounwind {
666   %x = alloca i8**, align 8
667   store i8** getelementptr inbounds ([5 x i8*]* @_ZTV1X, i64 0, i64 2), i8*** %x, align 8
668   call void @use() nounwind
669   %DEAD = load i8*** %x, align 8
670   call void @use3(i8*** %x, i8** %DEAD) nounwind
671   ret void
672 ; CHECK: test_escape1
673 ; CHECK-NOT: DEAD
674 ; CHECK: ret
675 }