Dan Gohman | 448db1c | 2010-04-07 22:27:08 +0000 | [diff] [blame] | 1 | ; RUN: llc -asm-verbose=false -disable-branch-fold -disable-code-place -disable-tail-duplicate -march=x86-64 < %s | FileCheck %s |
| 2 | ; rdar://7236213 |
| 3 | |
| 4 | ; CodeGen shouldn't require any lea instructions inside the marked loop. |
| 5 | ; It should properly set up post-increment uses and do coalescing for |
| 6 | ; the induction variables. |
| 7 | |
| 8 | ; CHECK: # Start |
| 9 | ; CHECK-NOT: lea |
| 10 | ; CHECK: # Stop |
| 11 | |
| 12 | 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" |
| 13 | |
| 14 | define void @foo(float* %I, i64 %IS, float* nocapture %Start, float* nocapture %Step, float* %O, i64 %OS, i64 %N) nounwind { |
| 15 | entry: |
| 16 | %times4 = alloca float, align 4 ; <float*> [#uses=3] |
| 17 | %timesN = alloca float, align 4 ; <float*> [#uses=2] |
| 18 | %0 = load float* %Step, align 4 ; <float> [#uses=8] |
| 19 | %1 = ptrtoint float* %I to i64 ; <i64> [#uses=1] |
| 20 | %2 = ptrtoint float* %O to i64 ; <i64> [#uses=1] |
| 21 | %tmp = xor i64 %2, %1 ; <i64> [#uses=1] |
| 22 | %tmp16 = and i64 %tmp, 15 ; <i64> [#uses=1] |
| 23 | %3 = icmp eq i64 %tmp16, 0 ; <i1> [#uses=1] |
| 24 | %4 = trunc i64 %IS to i32 ; <i32> [#uses=1] |
| 25 | %5 = xor i32 %4, 1 ; <i32> [#uses=1] |
| 26 | %6 = trunc i64 %OS to i32 ; <i32> [#uses=1] |
| 27 | %7 = xor i32 %6, 1 ; <i32> [#uses=1] |
| 28 | %8 = or i32 %7, %5 ; <i32> [#uses=1] |
| 29 | %9 = icmp eq i32 %8, 0 ; <i1> [#uses=1] |
| 30 | br i1 %9, label %bb, label %return |
| 31 | |
| 32 | bb: ; preds = %entry |
| 33 | %10 = load float* %Start, align 4 ; <float> [#uses=1] |
| 34 | br label %bb2 |
| 35 | |
| 36 | bb1: ; preds = %bb3 |
| 37 | %11 = load float* %I_addr.0, align 4 ; <float> [#uses=1] |
| 38 | %12 = fmul float %11, %x.0 ; <float> [#uses=1] |
| 39 | store float %12, float* %O_addr.0, align 4 |
| 40 | %13 = fadd float %x.0, %0 ; <float> [#uses=1] |
| 41 | %indvar.next53 = add i64 %14, 1 ; <i64> [#uses=1] |
| 42 | br label %bb2 |
| 43 | |
| 44 | bb2: ; preds = %bb1, %bb |
| 45 | %14 = phi i64 [ %indvar.next53, %bb1 ], [ 0, %bb ] ; <i64> [#uses=21] |
| 46 | %x.0 = phi float [ %13, %bb1 ], [ %10, %bb ] ; <float> [#uses=6] |
| 47 | %N_addr.0 = sub i64 %N, %14 ; <i64> [#uses=4] |
| 48 | %O_addr.0 = getelementptr float* %O, i64 %14 ; <float*> [#uses=4] |
| 49 | %I_addr.0 = getelementptr float* %I, i64 %14 ; <float*> [#uses=3] |
| 50 | %15 = icmp slt i64 %N_addr.0, 1 ; <i1> [#uses=1] |
| 51 | br i1 %15, label %bb4, label %bb3 |
| 52 | |
| 53 | bb3: ; preds = %bb2 |
| 54 | %16 = ptrtoint float* %O_addr.0 to i64 ; <i64> [#uses=1] |
| 55 | %17 = and i64 %16, 15 ; <i64> [#uses=1] |
| 56 | %18 = icmp eq i64 %17, 0 ; <i1> [#uses=1] |
| 57 | br i1 %18, label %bb4, label %bb1 |
| 58 | |
| 59 | bb4: ; preds = %bb3, %bb2 |
| 60 | %19 = fmul float %0, 4.000000e+00 ; <float> [#uses=1] |
| 61 | store float %19, float* %times4, align 4 |
| 62 | %20 = fmul float %0, 1.600000e+01 ; <float> [#uses=1] |
| 63 | store float %20, float* %timesN, align 4 |
| 64 | %21 = fmul float %0, 0.000000e+00 ; <float> [#uses=1] |
| 65 | %22 = fadd float %21, %x.0 ; <float> [#uses=1] |
| 66 | %23 = fadd float %x.0, %0 ; <float> [#uses=1] |
| 67 | %24 = fmul float %0, 2.000000e+00 ; <float> [#uses=1] |
| 68 | %25 = fadd float %24, %x.0 ; <float> [#uses=1] |
| 69 | %26 = fmul float %0, 3.000000e+00 ; <float> [#uses=1] |
| 70 | %27 = fadd float %26, %x.0 ; <float> [#uses=1] |
| 71 | %28 = insertelement <4 x float> undef, float %22, i32 0 ; <<4 x float>> [#uses=1] |
| 72 | %29 = insertelement <4 x float> %28, float %23, i32 1 ; <<4 x float>> [#uses=1] |
| 73 | %30 = insertelement <4 x float> %29, float %25, i32 2 ; <<4 x float>> [#uses=1] |
| 74 | %31 = insertelement <4 x float> %30, float %27, i32 3 ; <<4 x float>> [#uses=5] |
| 75 | %asmtmp.i = call <4 x float> asm "movss $1, $0\09\0Apshufd $$0, $0, $0", "=x,*m,~{dirflag},~{fpsr},~{flags}"(float* %times4) nounwind ; <<4 x float>> [#uses=3] |
| 76 | %32 = fadd <4 x float> %31, %asmtmp.i ; <<4 x float>> [#uses=3] |
| 77 | %33 = fadd <4 x float> %32, %asmtmp.i ; <<4 x float>> [#uses=3] |
| 78 | %34 = fadd <4 x float> %33, %asmtmp.i ; <<4 x float>> [#uses=2] |
| 79 | %asmtmp.i18 = call <4 x float> asm "movss $1, $0\09\0Apshufd $$0, $0, $0", "=x,*m,~{dirflag},~{fpsr},~{flags}"(float* %timesN) nounwind ; <<4 x float>> [#uses=8] |
| 80 | %35 = icmp sgt i64 %N_addr.0, 15 ; <i1> [#uses=2] |
| 81 | br i1 %3, label %bb6.preheader, label %bb8 |
| 82 | |
| 83 | bb6.preheader: ; preds = %bb4 |
| 84 | br i1 %35, label %bb.nph43, label %bb7 |
| 85 | |
| 86 | bb.nph43: ; preds = %bb6.preheader |
| 87 | %tmp108 = add i64 %14, 16 ; <i64> [#uses=1] |
| 88 | %tmp111 = add i64 %14, 4 ; <i64> [#uses=1] |
| 89 | %tmp115 = add i64 %14, 8 ; <i64> [#uses=1] |
| 90 | %tmp119 = add i64 %14, 12 ; <i64> [#uses=1] |
| 91 | %tmp134 = add i64 %N, -16 ; <i64> [#uses=1] |
| 92 | %tmp135 = sub i64 %tmp134, %14 ; <i64> [#uses=1] |
| 93 | call void asm sideeffect "# Start.", "~{dirflag},~{fpsr},~{flags}"() nounwind |
| 94 | br label %bb5 |
| 95 | |
| 96 | bb5: ; preds = %bb.nph43, %bb5 |
| 97 | %indvar102 = phi i64 [ 0, %bb.nph43 ], [ %indvar.next103, %bb5 ] ; <i64> [#uses=3] |
| 98 | %vX3.041 = phi <4 x float> [ %34, %bb.nph43 ], [ %45, %bb5 ] ; <<4 x float>> [#uses=2] |
| 99 | %vX0.039 = phi <4 x float> [ %31, %bb.nph43 ], [ %41, %bb5 ] ; <<4 x float>> [#uses=2] |
| 100 | %vX2.037 = phi <4 x float> [ %33, %bb.nph43 ], [ %46, %bb5 ] ; <<4 x float>> [#uses=2] |
| 101 | %vX1.036 = phi <4 x float> [ %32, %bb.nph43 ], [ %47, %bb5 ] ; <<4 x float>> [#uses=2] |
| 102 | %tmp104 = shl i64 %indvar102, 4 ; <i64> [#uses=5] |
| 103 | %tmp105 = add i64 %14, %tmp104 ; <i64> [#uses=2] |
| 104 | %scevgep106 = getelementptr float* %I, i64 %tmp105 ; <float*> [#uses=1] |
| 105 | %scevgep106107 = bitcast float* %scevgep106 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 106 | %tmp109 = add i64 %tmp108, %tmp104 ; <i64> [#uses=2] |
| 107 | %tmp112 = add i64 %tmp111, %tmp104 ; <i64> [#uses=2] |
| 108 | %scevgep113 = getelementptr float* %I, i64 %tmp112 ; <float*> [#uses=1] |
| 109 | %scevgep113114 = bitcast float* %scevgep113 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 110 | %tmp116 = add i64 %tmp115, %tmp104 ; <i64> [#uses=2] |
| 111 | %scevgep117 = getelementptr float* %I, i64 %tmp116 ; <float*> [#uses=1] |
| 112 | %scevgep117118 = bitcast float* %scevgep117 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 113 | %tmp120 = add i64 %tmp119, %tmp104 ; <i64> [#uses=2] |
| 114 | %scevgep121 = getelementptr float* %I, i64 %tmp120 ; <float*> [#uses=1] |
| 115 | %scevgep121122 = bitcast float* %scevgep121 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 116 | %scevgep123 = getelementptr float* %O, i64 %tmp105 ; <float*> [#uses=1] |
| 117 | %scevgep123124 = bitcast float* %scevgep123 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 118 | %scevgep126 = getelementptr float* %O, i64 %tmp112 ; <float*> [#uses=1] |
| 119 | %scevgep126127 = bitcast float* %scevgep126 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 120 | %scevgep128 = getelementptr float* %O, i64 %tmp116 ; <float*> [#uses=1] |
| 121 | %scevgep128129 = bitcast float* %scevgep128 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 122 | %scevgep130 = getelementptr float* %O, i64 %tmp120 ; <float*> [#uses=1] |
| 123 | %scevgep130131 = bitcast float* %scevgep130 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 124 | %tmp132 = mul i64 %indvar102, -16 ; <i64> [#uses=1] |
| 125 | %tmp136 = add i64 %tmp135, %tmp132 ; <i64> [#uses=2] |
| 126 | %36 = load <4 x float>* %scevgep106107, align 16 ; <<4 x float>> [#uses=1] |
| 127 | %37 = load <4 x float>* %scevgep113114, align 16 ; <<4 x float>> [#uses=1] |
| 128 | %38 = load <4 x float>* %scevgep117118, align 16 ; <<4 x float>> [#uses=1] |
| 129 | %39 = load <4 x float>* %scevgep121122, align 16 ; <<4 x float>> [#uses=1] |
| 130 | %40 = fmul <4 x float> %36, %vX0.039 ; <<4 x float>> [#uses=1] |
| 131 | %41 = fadd <4 x float> %vX0.039, %asmtmp.i18 ; <<4 x float>> [#uses=2] |
| 132 | %42 = fmul <4 x float> %37, %vX1.036 ; <<4 x float>> [#uses=1] |
| 133 | %43 = fmul <4 x float> %38, %vX2.037 ; <<4 x float>> [#uses=1] |
| 134 | %44 = fmul <4 x float> %39, %vX3.041 ; <<4 x float>> [#uses=1] |
| 135 | store <4 x float> %40, <4 x float>* %scevgep123124, align 16 |
| 136 | store <4 x float> %42, <4 x float>* %scevgep126127, align 16 |
| 137 | store <4 x float> %43, <4 x float>* %scevgep128129, align 16 |
| 138 | store <4 x float> %44, <4 x float>* %scevgep130131, align 16 |
| 139 | %45 = fadd <4 x float> %vX3.041, %asmtmp.i18 ; <<4 x float>> [#uses=1] |
| 140 | %46 = fadd <4 x float> %vX2.037, %asmtmp.i18 ; <<4 x float>> [#uses=1] |
| 141 | %47 = fadd <4 x float> %vX1.036, %asmtmp.i18 ; <<4 x float>> [#uses=1] |
| 142 | %48 = icmp sgt i64 %tmp136, 15 ; <i1> [#uses=1] |
| 143 | %indvar.next103 = add i64 %indvar102, 1 ; <i64> [#uses=1] |
| 144 | br i1 %48, label %bb5, label %bb6.bb7_crit_edge |
| 145 | |
| 146 | bb6.bb7_crit_edge: ; preds = %bb5 |
| 147 | call void asm sideeffect "# Stop.", "~{dirflag},~{fpsr},~{flags}"() nounwind |
| 148 | %scevgep110 = getelementptr float* %I, i64 %tmp109 ; <float*> [#uses=1] |
| 149 | %scevgep125 = getelementptr float* %O, i64 %tmp109 ; <float*> [#uses=1] |
| 150 | br label %bb7 |
| 151 | |
| 152 | bb7: ; preds = %bb6.bb7_crit_edge, %bb6.preheader |
| 153 | %I_addr.1.lcssa = phi float* [ %scevgep110, %bb6.bb7_crit_edge ], [ %I_addr.0, %bb6.preheader ] ; <float*> [#uses=1] |
| 154 | %O_addr.1.lcssa = phi float* [ %scevgep125, %bb6.bb7_crit_edge ], [ %O_addr.0, %bb6.preheader ] ; <float*> [#uses=1] |
| 155 | %vX0.0.lcssa = phi <4 x float> [ %41, %bb6.bb7_crit_edge ], [ %31, %bb6.preheader ] ; <<4 x float>> [#uses=1] |
| 156 | %N_addr.1.lcssa = phi i64 [ %tmp136, %bb6.bb7_crit_edge ], [ %N_addr.0, %bb6.preheader ] ; <i64> [#uses=1] |
| 157 | %asmtmp.i17 = call <4 x float> asm "movss $1, $0\09\0Apshufd $$0, $0, $0", "=x,*m,~{dirflag},~{fpsr},~{flags}"(float* %times4) nounwind ; <<4 x float>> [#uses=0] |
| 158 | br label %bb11 |
| 159 | |
| 160 | bb8: ; preds = %bb4 |
| 161 | br i1 %35, label %bb.nph, label %bb11 |
| 162 | |
| 163 | bb.nph: ; preds = %bb8 |
| 164 | %I_addr.0.sum = add i64 %14, -1 ; <i64> [#uses=1] |
| 165 | %49 = getelementptr inbounds float* %I, i64 %I_addr.0.sum ; <float*> [#uses=1] |
| 166 | %50 = bitcast float* %49 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 167 | %51 = load <4 x float>* %50, align 16 ; <<4 x float>> [#uses=1] |
| 168 | %tmp54 = add i64 %14, 16 ; <i64> [#uses=1] |
| 169 | %tmp56 = add i64 %14, 3 ; <i64> [#uses=1] |
| 170 | %tmp60 = add i64 %14, 7 ; <i64> [#uses=1] |
| 171 | %tmp64 = add i64 %14, 11 ; <i64> [#uses=1] |
| 172 | %tmp68 = add i64 %14, 15 ; <i64> [#uses=1] |
| 173 | %tmp76 = add i64 %14, 4 ; <i64> [#uses=1] |
| 174 | %tmp80 = add i64 %14, 8 ; <i64> [#uses=1] |
| 175 | %tmp84 = add i64 %14, 12 ; <i64> [#uses=1] |
| 176 | %tmp90 = add i64 %N, -16 ; <i64> [#uses=1] |
| 177 | %tmp91 = sub i64 %tmp90, %14 ; <i64> [#uses=1] |
| 178 | br label %bb9 |
| 179 | |
| 180 | bb9: ; preds = %bb.nph, %bb9 |
| 181 | %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %bb9 ] ; <i64> [#uses=3] |
| 182 | %vX3.125 = phi <4 x float> [ %34, %bb.nph ], [ %69, %bb9 ] ; <<4 x float>> [#uses=2] |
| 183 | %vX0.223 = phi <4 x float> [ %31, %bb.nph ], [ %65, %bb9 ] ; <<4 x float>> [#uses=2] |
| 184 | %vX2.121 = phi <4 x float> [ %33, %bb.nph ], [ %70, %bb9 ] ; <<4 x float>> [#uses=2] |
| 185 | %vX1.120 = phi <4 x float> [ %32, %bb.nph ], [ %71, %bb9 ] ; <<4 x float>> [#uses=2] |
| 186 | %vI0.019 = phi <4 x float> [ %51, %bb.nph ], [ %55, %bb9 ] ; <<4 x float>> [#uses=1] |
| 187 | %tmp51 = shl i64 %indvar, 4 ; <i64> [#uses=9] |
| 188 | %tmp55 = add i64 %tmp54, %tmp51 ; <i64> [#uses=2] |
| 189 | %tmp57 = add i64 %tmp56, %tmp51 ; <i64> [#uses=1] |
| 190 | %scevgep58 = getelementptr float* %I, i64 %tmp57 ; <float*> [#uses=1] |
| 191 | %scevgep5859 = bitcast float* %scevgep58 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 192 | %tmp61 = add i64 %tmp60, %tmp51 ; <i64> [#uses=1] |
| 193 | %scevgep62 = getelementptr float* %I, i64 %tmp61 ; <float*> [#uses=1] |
| 194 | %scevgep6263 = bitcast float* %scevgep62 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 195 | %tmp65 = add i64 %tmp64, %tmp51 ; <i64> [#uses=1] |
| 196 | %scevgep66 = getelementptr float* %I, i64 %tmp65 ; <float*> [#uses=1] |
| 197 | %scevgep6667 = bitcast float* %scevgep66 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 198 | %tmp69 = add i64 %tmp68, %tmp51 ; <i64> [#uses=1] |
| 199 | %scevgep70 = getelementptr float* %I, i64 %tmp69 ; <float*> [#uses=1] |
| 200 | %scevgep7071 = bitcast float* %scevgep70 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 201 | %tmp72 = add i64 %14, %tmp51 ; <i64> [#uses=1] |
| 202 | %scevgep73 = getelementptr float* %O, i64 %tmp72 ; <float*> [#uses=1] |
| 203 | %scevgep7374 = bitcast float* %scevgep73 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 204 | %tmp77 = add i64 %tmp76, %tmp51 ; <i64> [#uses=1] |
| 205 | %scevgep78 = getelementptr float* %O, i64 %tmp77 ; <float*> [#uses=1] |
| 206 | %scevgep7879 = bitcast float* %scevgep78 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 207 | %tmp81 = add i64 %tmp80, %tmp51 ; <i64> [#uses=1] |
| 208 | %scevgep82 = getelementptr float* %O, i64 %tmp81 ; <float*> [#uses=1] |
| 209 | %scevgep8283 = bitcast float* %scevgep82 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 210 | %tmp85 = add i64 %tmp84, %tmp51 ; <i64> [#uses=1] |
| 211 | %scevgep86 = getelementptr float* %O, i64 %tmp85 ; <float*> [#uses=1] |
| 212 | %scevgep8687 = bitcast float* %scevgep86 to <4 x float>* ; <<4 x float>*> [#uses=1] |
| 213 | %tmp88 = mul i64 %indvar, -16 ; <i64> [#uses=1] |
| 214 | %tmp92 = add i64 %tmp91, %tmp88 ; <i64> [#uses=2] |
| 215 | %52 = load <4 x float>* %scevgep5859, align 16 ; <<4 x float>> [#uses=2] |
| 216 | %53 = load <4 x float>* %scevgep6263, align 16 ; <<4 x float>> [#uses=2] |
| 217 | %54 = load <4 x float>* %scevgep6667, align 16 ; <<4 x float>> [#uses=2] |
| 218 | %55 = load <4 x float>* %scevgep7071, align 16 ; <<4 x float>> [#uses=2] |
| 219 | %56 = shufflevector <4 x float> %vI0.019, <4 x float> %52, <4 x i32> <i32 4, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1] |
| 220 | %57 = shufflevector <4 x float> %56, <4 x float> undef, <4 x i32> <i32 1, i32 2, i32 3, i32 0> ; <<4 x float>> [#uses=1] |
| 221 | %58 = shufflevector <4 x float> %52, <4 x float> %53, <4 x i32> <i32 4, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1] |
| 222 | %59 = shufflevector <4 x float> %58, <4 x float> undef, <4 x i32> <i32 1, i32 2, i32 3, i32 0> ; <<4 x float>> [#uses=1] |
| 223 | %60 = shufflevector <4 x float> %53, <4 x float> %54, <4 x i32> <i32 4, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1] |
| 224 | %61 = shufflevector <4 x float> %60, <4 x float> undef, <4 x i32> <i32 1, i32 2, i32 3, i32 0> ; <<4 x float>> [#uses=1] |
| 225 | %62 = shufflevector <4 x float> %54, <4 x float> %55, <4 x i32> <i32 4, i32 1, i32 2, i32 3> ; <<4 x float>> [#uses=1] |
| 226 | %63 = shufflevector <4 x float> %62, <4 x float> undef, <4 x i32> <i32 1, i32 2, i32 3, i32 0> ; <<4 x float>> [#uses=1] |
| 227 | %64 = fmul <4 x float> %57, %vX0.223 ; <<4 x float>> [#uses=1] |
| 228 | %65 = fadd <4 x float> %vX0.223, %asmtmp.i18 ; <<4 x float>> [#uses=2] |
| 229 | %66 = fmul <4 x float> %59, %vX1.120 ; <<4 x float>> [#uses=1] |
| 230 | %67 = fmul <4 x float> %61, %vX2.121 ; <<4 x float>> [#uses=1] |
| 231 | %68 = fmul <4 x float> %63, %vX3.125 ; <<4 x float>> [#uses=1] |
| 232 | store <4 x float> %64, <4 x float>* %scevgep7374, align 16 |
| 233 | store <4 x float> %66, <4 x float>* %scevgep7879, align 16 |
| 234 | store <4 x float> %67, <4 x float>* %scevgep8283, align 16 |
| 235 | store <4 x float> %68, <4 x float>* %scevgep8687, align 16 |
| 236 | %69 = fadd <4 x float> %vX3.125, %asmtmp.i18 ; <<4 x float>> [#uses=1] |
| 237 | %70 = fadd <4 x float> %vX2.121, %asmtmp.i18 ; <<4 x float>> [#uses=1] |
| 238 | %71 = fadd <4 x float> %vX1.120, %asmtmp.i18 ; <<4 x float>> [#uses=1] |
| 239 | %72 = icmp sgt i64 %tmp92, 15 ; <i1> [#uses=1] |
| 240 | %indvar.next = add i64 %indvar, 1 ; <i64> [#uses=1] |
| 241 | br i1 %72, label %bb9, label %bb10.bb11.loopexit_crit_edge |
| 242 | |
| 243 | bb10.bb11.loopexit_crit_edge: ; preds = %bb9 |
| 244 | %scevgep = getelementptr float* %I, i64 %tmp55 ; <float*> [#uses=1] |
| 245 | %scevgep75 = getelementptr float* %O, i64 %tmp55 ; <float*> [#uses=1] |
| 246 | br label %bb11 |
| 247 | |
| 248 | bb11: ; preds = %bb8, %bb10.bb11.loopexit_crit_edge, %bb7 |
| 249 | %N_addr.2 = phi i64 [ %N_addr.1.lcssa, %bb7 ], [ %tmp92, %bb10.bb11.loopexit_crit_edge ], [ %N_addr.0, %bb8 ] ; <i64> [#uses=2] |
| 250 | %vX0.1 = phi <4 x float> [ %vX0.0.lcssa, %bb7 ], [ %65, %bb10.bb11.loopexit_crit_edge ], [ %31, %bb8 ] ; <<4 x float>> [#uses=1] |
| 251 | %O_addr.2 = phi float* [ %O_addr.1.lcssa, %bb7 ], [ %scevgep75, %bb10.bb11.loopexit_crit_edge ], [ %O_addr.0, %bb8 ] ; <float*> [#uses=1] |
| 252 | %I_addr.2 = phi float* [ %I_addr.1.lcssa, %bb7 ], [ %scevgep, %bb10.bb11.loopexit_crit_edge ], [ %I_addr.0, %bb8 ] ; <float*> [#uses=1] |
| 253 | %73 = extractelement <4 x float> %vX0.1, i32 0 ; <float> [#uses=2] |
| 254 | %74 = icmp sgt i64 %N_addr.2, 0 ; <i1> [#uses=1] |
| 255 | br i1 %74, label %bb12, label %bb14 |
| 256 | |
| 257 | bb12: ; preds = %bb11, %bb12 |
| 258 | %indvar94 = phi i64 [ %indvar.next95, %bb12 ], [ 0, %bb11 ] ; <i64> [#uses=3] |
| 259 | %x.130 = phi float [ %77, %bb12 ], [ %73, %bb11 ] ; <float> [#uses=2] |
| 260 | %I_addr.433 = getelementptr float* %I_addr.2, i64 %indvar94 ; <float*> [#uses=1] |
| 261 | %O_addr.432 = getelementptr float* %O_addr.2, i64 %indvar94 ; <float*> [#uses=1] |
| 262 | %75 = load float* %I_addr.433, align 4 ; <float> [#uses=1] |
| 263 | %76 = fmul float %75, %x.130 ; <float> [#uses=1] |
| 264 | store float %76, float* %O_addr.432, align 4 |
| 265 | %77 = fadd float %x.130, %0 ; <float> [#uses=2] |
| 266 | %indvar.next95 = add i64 %indvar94, 1 ; <i64> [#uses=2] |
| 267 | %exitcond = icmp eq i64 %indvar.next95, %N_addr.2 ; <i1> [#uses=1] |
| 268 | br i1 %exitcond, label %bb14, label %bb12 |
| 269 | |
| 270 | bb14: ; preds = %bb12, %bb11 |
| 271 | %x.1.lcssa = phi float [ %73, %bb11 ], [ %77, %bb12 ] ; <float> [#uses=1] |
| 272 | store float %x.1.lcssa, float* %Start, align 4 |
| 273 | ret void |
| 274 | |
| 275 | return: ; preds = %entry |
| 276 | ret void |
| 277 | } |
Dan Gohman | 701a4ae | 2010-04-08 05:57:57 +0000 | [diff] [blame] | 278 | |
| 279 | ; Codegen shouldn't crash on this testcase. |
| 280 | |
| 281 | define void @bar(i32 %a, i32 %b) nounwind { |
| 282 | entry: ; preds = %bb1, %entry, %for.end204 |
| 283 | br label %outer |
| 284 | |
| 285 | outer: ; preds = %bb1, %entry |
| 286 | %i6 = phi i32 [ %storemerge171, %bb1 ], [ %a, %entry ] ; <i32> [#uses=2] |
| 287 | %storemerge171 = add i32 %i6, 1 ; <i32> [#uses=1] |
| 288 | br label %inner |
| 289 | |
| 290 | inner: ; preds = %bb0, %if.end275 |
| 291 | %i8 = phi i32 [ %a, %outer ], [ %indvar.next159, %bb0 ] ; <i32> [#uses=2] |
| 292 | %t338 = load i32* undef ; <i32> [#uses=1] |
| 293 | %t191 = mul i32 %i8, %t338 ; <i32> [#uses=1] |
| 294 | %t179 = add i32 %i6, %t191 ; <i32> [#uses=1] |
| 295 | br label %bb0 |
| 296 | |
| 297 | bb0: ; preds = %for.body332 |
| 298 | %indvar.next159 = add i32 %i8, 1 ; <i32> [#uses=1] |
| 299 | br i1 undef, label %bb1, label %inner |
| 300 | |
| 301 | bb1: ; preds = %bb0, %outer |
| 302 | %midx.4 = phi i32 [ %t179, %bb0 ] ; <i32> [#uses=0] |
| 303 | br label %outer |
| 304 | } |