1 ; RUN: opt < %s -loop-reduce -S | not grep uglygep
3 ; LSR shouldn't consider %t8 to be an interesting user of %t6, and it
4 ; should be able to form pretty GEPs.
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
8 define void @Z4() nounwind {
13 br i1 undef, label %bb10, label %bb2
16 %t = add i64 %t4, 1 ; <i64> [#uses=1]
19 bb3: ; preds = %bb2, %bb
20 %t4 = phi i64 [ %t, %bb2 ], [ 0, %bb ] ; <i64> [#uses=3]
24 %t7 = icmp eq i64 %t4, 0 ; <i1> [#uses=1]
25 %t3 = add i64 %t4, 16 ; <i64> [#uses=1]
28 bb14: ; preds = %bb14, %bb10
29 %t2 = getelementptr inbounds i8* undef, i64 %t4 ; <i8*> [#uses=1]
30 store i8 undef, i8* %t2
31 %t6 = load float** undef
32 %t8 = bitcast float* %t6 to i8* ; <i8*> [#uses=1]
33 %t9 = getelementptr inbounds i8* %t8, i64 %t3 ; <i8*> [#uses=1]
34 store i8 undef, i8* %t9
38 define fastcc void @TransformLine() nounwind {
42 loop0: ; preds = %loop0, %bb
43 %i0 = phi i32 [ %i0.next, %loop0 ], [ 0, %bb ] ; <i32> [#uses=2]
44 %i0.next = add i32 %i0, 1 ; <i32> [#uses=1]
45 br i1 false, label %loop0, label %bb0
50 loop1: ; preds = %bb5, %bb0
51 %i1 = phi i32 [ 0, %bb0 ], [ %i1.next, %bb5 ] ; <i32> [#uses=4]
52 %t0 = add i32 %i0, %i1 ; <i32> [#uses=1]
53 br i1 false, label %bb2, label %bb6
56 br i1 true, label %bb6, label %bb5
59 %i1.next = add i32 %i1, 1 ; <i32> [#uses=1]
60 br i1 true, label %bb6, label %loop1
62 bb6: ; preds = %bb5, %bb2, %loop1
63 %p8 = phi i32 [ %t0, %bb5 ], [ undef, %loop1 ], [ undef, %bb2 ] ; <i32> [#uses=0]
64 %p9 = phi i32 [ undef, %bb5 ], [ %i1, %loop1 ], [ %i1, %bb2 ] ; <i32> [#uses=0]