1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -loop-vectorize < %s | FileCheck %s
3
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5target triple = "x86_64-unknown-linux-gnu"
6
7define float @reduction_sum_float_ieee(i32 %n, float* %array) {
8; CHECK-LABEL: @reduction_sum_float_ieee(
9; CHECK-NEXT:  entry:
10; CHECK-NEXT:    [[ENTRY_COND:%.*]] = icmp ne i32 0, 4096
11; CHECK-NEXT:    br i1 [[ENTRY_COND]], label [[LOOP_PREHEADER:%.*]], label [[LOOP_EXIT:%.*]]
12; CHECK:       loop.preheader:
13; CHECK-NEXT:    br label [[LOOP:%.*]]
14; CHECK:       loop:
15; CHECK-NEXT:    [[IDX:%.*]] = phi i32 [ [[IDX_INC:%.*]], [[LOOP]] ], [ 0, [[LOOP_PREHEADER]] ]
16; CHECK-NEXT:    [[SUM:%.*]] = phi float [ [[SUM_INC:%.*]], [[LOOP]] ], [ 0.000000e+00, [[LOOP_PREHEADER]] ]
17; CHECK-NEXT:    [[ADDRESS:%.*]] = getelementptr float, float* [[ARRAY:%.*]], i32 [[IDX]]
18; CHECK-NEXT:    [[VALUE:%.*]] = load float, float* [[ADDRESS]], align 4
19; CHECK-NEXT:    [[SUM_INC]] = fadd float [[SUM]], [[VALUE]]
20; CHECK-NEXT:    [[IDX_INC]] = add i32 [[IDX]], 1
21; CHECK-NEXT:    [[BE_COND:%.*]] = icmp ne i32 [[IDX_INC]], 4096
22; CHECK-NEXT:    br i1 [[BE_COND]], label [[LOOP]], label [[LOOP_EXIT_LOOPEXIT:%.*]]
23; CHECK:       loop.exit.loopexit:
24; CHECK-NEXT:    [[SUM_INC_LCSSA:%.*]] = phi float [ [[SUM_INC]], [[LOOP]] ]
25; CHECK-NEXT:    br label [[LOOP_EXIT]]
26; CHECK:       loop.exit:
27; CHECK-NEXT:    [[SUM_LCSSA:%.*]] = phi float [ 0.000000e+00, [[ENTRY:%.*]] ], [ [[SUM_INC_LCSSA]], [[LOOP_EXIT_LOOPEXIT]] ]
28; CHECK-NEXT:    ret float [[SUM_LCSSA]]
29;
30entry:
31  %entry.cond = icmp ne i32 0, 4096
32  br i1 %entry.cond, label %loop, label %loop.exit
33
34loop:
35  %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
36  %sum = phi float [ 0.000000e+00, %entry ], [ %sum.inc, %loop ]
37  %address = getelementptr float, float* %array, i32 %idx
38  %value = load float, float* %address
39  %sum.inc = fadd float %sum, %value
40  %idx.inc = add i32 %idx, 1
41  %be.cond = icmp ne i32 %idx.inc, 4096
42  br i1 %be.cond, label %loop, label %loop.exit
43
44loop.exit:
45  %sum.lcssa = phi float [ %sum.inc, %loop ], [ 0.000000e+00, %entry ]
46  ret float %sum.lcssa
47}
48
49define float @reduction_sum_float_fastmath(i32 %n, float* %array) {
50; CHECK-LABEL: @reduction_sum_float_fastmath(
51; CHECK-NEXT:  entry:
52; CHECK-NEXT:    [[ENTRY_COND:%.*]] = icmp ne i32 0, 4096
53; CHECK-NEXT:    br i1 [[ENTRY_COND]], label [[LOOP_PREHEADER:%.*]], label [[LOOP_EXIT:%.*]]
54; CHECK:       loop.preheader:
55; CHECK-NEXT:    br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
56; CHECK:       vector.ph:
57; CHECK-NEXT:    br label [[VECTOR_BODY:%.*]]
58; CHECK:       vector.body:
59; CHECK-NEXT:    [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
60; CHECK-NEXT:    [[VEC_PHI:%.*]] = phi <4 x float> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP8:%.*]], [[VECTOR_BODY]] ]
61; CHECK-NEXT:    [[VEC_PHI1:%.*]] = phi <4 x float> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP9:%.*]], [[VECTOR_BODY]] ]
62; CHECK-NEXT:    [[TMP0:%.*]] = add i32 [[INDEX]], 0
63; CHECK-NEXT:    [[TMP1:%.*]] = add i32 [[INDEX]], 4
64; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr float, float* [[ARRAY:%.*]], i32 [[TMP0]]
65; CHECK-NEXT:    [[TMP3:%.*]] = getelementptr float, float* [[ARRAY]], i32 [[TMP1]]
66; CHECK-NEXT:    [[TMP4:%.*]] = getelementptr float, float* [[TMP2]], i32 0
67; CHECK-NEXT:    [[TMP5:%.*]] = bitcast float* [[TMP4]] to <4 x float>*
68; CHECK-NEXT:    [[WIDE_LOAD:%.*]] = load <4 x float>, <4 x float>* [[TMP5]], align 4
69; CHECK-NEXT:    [[TMP6:%.*]] = getelementptr float, float* [[TMP2]], i32 4
70; CHECK-NEXT:    [[TMP7:%.*]] = bitcast float* [[TMP6]] to <4 x float>*
71; CHECK-NEXT:    [[WIDE_LOAD2:%.*]] = load <4 x float>, <4 x float>* [[TMP7]], align 4
72; CHECK-NEXT:    [[TMP8]] = fadd fast <4 x float> [[VEC_PHI]], [[WIDE_LOAD]]
73; CHECK-NEXT:    [[TMP9]] = fadd fast <4 x float> [[VEC_PHI1]], [[WIDE_LOAD2]]
74; CHECK-NEXT:    [[INDEX_NEXT]] = add i32 [[INDEX]], 8
75; CHECK-NEXT:    [[TMP10:%.*]] = icmp eq i32 [[INDEX_NEXT]], 4096
76; CHECK-NEXT:    br i1 [[TMP10]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], [[LOOP0:!llvm.loop !.*]]
77; CHECK:       middle.block:
78; CHECK-NEXT:    [[BIN_RDX:%.*]] = fadd fast <4 x float> [[TMP9]], [[TMP8]]
79; CHECK-NEXT:    [[TMP11:%.*]] = call fast float @llvm.vector.reduce.fadd.v4f32(float -0.000000e+00, <4 x float> [[BIN_RDX]])
80; CHECK-NEXT:    [[CMP_N:%.*]] = icmp eq i32 4096, 4096
81; CHECK-NEXT:    br i1 [[CMP_N]], label [[LOOP_EXIT_LOOPEXIT:%.*]], label [[SCALAR_PH]]
82; CHECK:       scalar.ph:
83; CHECK-NEXT:    [[BC_RESUME_VAL:%.*]] = phi i32 [ 4096, [[MIDDLE_BLOCK]] ], [ 0, [[LOOP_PREHEADER]] ]
84; CHECK-NEXT:    [[BC_MERGE_RDX:%.*]] = phi float [ 0.000000e+00, [[LOOP_PREHEADER]] ], [ [[TMP11]], [[MIDDLE_BLOCK]] ]
85; CHECK-NEXT:    br label [[LOOP:%.*]]
86; CHECK:       loop:
87; CHECK-NEXT:    [[IDX:%.*]] = phi i32 [ [[IDX_INC:%.*]], [[LOOP]] ], [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ]
88; CHECK-NEXT:    [[SUM:%.*]] = phi float [ [[SUM_INC:%.*]], [[LOOP]] ], [ [[BC_MERGE_RDX]], [[SCALAR_PH]] ]
89; CHECK-NEXT:    [[ADDRESS:%.*]] = getelementptr float, float* [[ARRAY]], i32 [[IDX]]
90; CHECK-NEXT:    [[VALUE:%.*]] = load float, float* [[ADDRESS]], align 4
91; CHECK-NEXT:    [[SUM_INC]] = fadd fast float [[SUM]], [[VALUE]]
92; CHECK-NEXT:    [[IDX_INC]] = add i32 [[IDX]], 1
93; CHECK-NEXT:    [[BE_COND:%.*]] = icmp ne i32 [[IDX_INC]], 4096
94; CHECK-NEXT:    br i1 [[BE_COND]], label [[LOOP]], label [[LOOP_EXIT_LOOPEXIT]], [[LOOP2:!llvm.loop !.*]]
95; CHECK:       loop.exit.loopexit:
96; CHECK-NEXT:    [[SUM_INC_LCSSA:%.*]] = phi float [ [[SUM_INC]], [[LOOP]] ], [ [[TMP11]], [[MIDDLE_BLOCK]] ]
97; CHECK-NEXT:    br label [[LOOP_EXIT]]
98; CHECK:       loop.exit:
99; CHECK-NEXT:    [[SUM_LCSSA:%.*]] = phi float [ 0.000000e+00, [[ENTRY:%.*]] ], [ [[SUM_INC_LCSSA]], [[LOOP_EXIT_LOOPEXIT]] ]
100; CHECK-NEXT:    ret float [[SUM_LCSSA]]
101;
102entry:
103  %entry.cond = icmp ne i32 0, 4096
104  br i1 %entry.cond, label %loop, label %loop.exit
105
106loop:
107  %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
108  %sum = phi float [ 0.000000e+00, %entry ], [ %sum.inc, %loop ]
109  %address = getelementptr float, float* %array, i32 %idx
110  %value = load float, float* %address
111  %sum.inc = fadd fast float %sum, %value
112  %idx.inc = add i32 %idx, 1
113  %be.cond = icmp ne i32 %idx.inc, 4096
114  br i1 %be.cond, label %loop, label %loop.exit
115
116loop.exit:
117  %sum.lcssa = phi float [ %sum.inc, %loop ], [ 0.000000e+00, %entry ]
118  ret float %sum.lcssa
119}
120
121define float @reduction_sum_float_only_reassoc(i32 %n, float* %array) {
122; CHECK-LABEL: @reduction_sum_float_only_reassoc(
123; CHECK-NEXT:  entry:
124; CHECK-NEXT:    [[ENTRY_COND:%.*]] = icmp ne i32 0, 4096
125; CHECK-NEXT:    br i1 [[ENTRY_COND]], label [[LOOP_PREHEADER:%.*]], label [[LOOP_EXIT:%.*]]
126; CHECK:       loop.preheader:
127; CHECK-NEXT:    br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
128; CHECK:       vector.ph:
129; CHECK-NEXT:    br label [[VECTOR_BODY:%.*]]
130; CHECK:       vector.body:
131; CHECK-NEXT:    [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
132; CHECK-NEXT:    [[VEC_PHI:%.*]] = phi <4 x float> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP8:%.*]], [[VECTOR_BODY]] ]
133; CHECK-NEXT:    [[VEC_PHI1:%.*]] = phi <4 x float> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP9:%.*]], [[VECTOR_BODY]] ]
134; CHECK-NEXT:    [[TMP0:%.*]] = add i32 [[INDEX]], 0
135; CHECK-NEXT:    [[TMP1:%.*]] = add i32 [[INDEX]], 4
136; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr float, float* [[ARRAY:%.*]], i32 [[TMP0]]
137; CHECK-NEXT:    [[TMP3:%.*]] = getelementptr float, float* [[ARRAY]], i32 [[TMP1]]
138; CHECK-NEXT:    [[TMP4:%.*]] = getelementptr float, float* [[TMP2]], i32 0
139; CHECK-NEXT:    [[TMP5:%.*]] = bitcast float* [[TMP4]] to <4 x float>*
140; CHECK-NEXT:    [[WIDE_LOAD:%.*]] = load <4 x float>, <4 x float>* [[TMP5]], align 4
141; CHECK-NEXT:    [[TMP6:%.*]] = getelementptr float, float* [[TMP2]], i32 4
142; CHECK-NEXT:    [[TMP7:%.*]] = bitcast float* [[TMP6]] to <4 x float>*
143; CHECK-NEXT:    [[WIDE_LOAD2:%.*]] = load <4 x float>, <4 x float>* [[TMP7]], align 4
144; CHECK-NEXT:    [[TMP8]] = fadd reassoc <4 x float> [[VEC_PHI]], [[WIDE_LOAD]]
145; CHECK-NEXT:    [[TMP9]] = fadd reassoc <4 x float> [[VEC_PHI1]], [[WIDE_LOAD2]]
146; CHECK-NEXT:    [[INDEX_NEXT]] = add i32 [[INDEX]], 8
147; CHECK-NEXT:    [[TMP10:%.*]] = icmp eq i32 [[INDEX_NEXT]], 4096
148; CHECK-NEXT:    br i1 [[TMP10]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], [[LOOP4:!llvm.loop !.*]]
149; CHECK:       middle.block:
150; CHECK-NEXT:    [[BIN_RDX:%.*]] = fadd reassoc <4 x float> [[TMP9]], [[TMP8]]
151; CHECK-NEXT:    [[TMP11:%.*]] = call reassoc float @llvm.vector.reduce.fadd.v4f32(float -0.000000e+00, <4 x float> [[BIN_RDX]])
152; CHECK-NEXT:    [[CMP_N:%.*]] = icmp eq i32 4096, 4096
153; CHECK-NEXT:    br i1 [[CMP_N]], label [[LOOP_EXIT_LOOPEXIT:%.*]], label [[SCALAR_PH]]
154; CHECK:       scalar.ph:
155; CHECK-NEXT:    [[BC_RESUME_VAL:%.*]] = phi i32 [ 4096, [[MIDDLE_BLOCK]] ], [ 0, [[LOOP_PREHEADER]] ]
156; CHECK-NEXT:    [[BC_MERGE_RDX:%.*]] = phi float [ 0.000000e+00, [[LOOP_PREHEADER]] ], [ [[TMP11]], [[MIDDLE_BLOCK]] ]
157; CHECK-NEXT:    br label [[LOOP:%.*]]
158; CHECK:       loop:
159; CHECK-NEXT:    [[IDX:%.*]] = phi i32 [ [[IDX_INC:%.*]], [[LOOP]] ], [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ]
160; CHECK-NEXT:    [[SUM:%.*]] = phi float [ [[SUM_INC:%.*]], [[LOOP]] ], [ [[BC_MERGE_RDX]], [[SCALAR_PH]] ]
161; CHECK-NEXT:    [[ADDRESS:%.*]] = getelementptr float, float* [[ARRAY]], i32 [[IDX]]
162; CHECK-NEXT:    [[VALUE:%.*]] = load float, float* [[ADDRESS]], align 4
163; CHECK-NEXT:    [[SUM_INC]] = fadd reassoc float [[SUM]], [[VALUE]]
164; CHECK-NEXT:    [[IDX_INC]] = add i32 [[IDX]], 1
165; CHECK-NEXT:    [[BE_COND:%.*]] = icmp ne i32 [[IDX_INC]], 4096
166; CHECK-NEXT:    br i1 [[BE_COND]], label [[LOOP]], label [[LOOP_EXIT_LOOPEXIT]], [[LOOP5:!llvm.loop !.*]]
167; CHECK:       loop.exit.loopexit:
168; CHECK-NEXT:    [[SUM_INC_LCSSA:%.*]] = phi float [ [[SUM_INC]], [[LOOP]] ], [ [[TMP11]], [[MIDDLE_BLOCK]] ]
169; CHECK-NEXT:    br label [[LOOP_EXIT]]
170; CHECK:       loop.exit:
171; CHECK-NEXT:    [[SUM_LCSSA:%.*]] = phi float [ 0.000000e+00, [[ENTRY:%.*]] ], [ [[SUM_INC_LCSSA]], [[LOOP_EXIT_LOOPEXIT]] ]
172; CHECK-NEXT:    ret float [[SUM_LCSSA]]
173;
174entry:
175  %entry.cond = icmp ne i32 0, 4096
176  br i1 %entry.cond, label %loop, label %loop.exit
177
178loop:
179  %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
180  %sum = phi float [ 0.000000e+00, %entry ], [ %sum.inc, %loop ]
181  %address = getelementptr float, float* %array, i32 %idx
182  %value = load float, float* %address
183  %sum.inc = fadd reassoc float %sum, %value
184  %idx.inc = add i32 %idx, 1
185  %be.cond = icmp ne i32 %idx.inc, 4096
186  br i1 %be.cond, label %loop, label %loop.exit
187
188loop.exit:
189  %sum.lcssa = phi float [ %sum.inc, %loop ], [ 0.000000e+00, %entry ]
190  ret float %sum.lcssa
191}
192
193define float @reduction_sum_float_only_reassoc_and_contract(i32 %n, float* %array) {
194; CHECK-LABEL: @reduction_sum_float_only_reassoc_and_contract(
195; CHECK-NEXT:  entry:
196; CHECK-NEXT:    [[ENTRY_COND:%.*]] = icmp ne i32 0, 4096
197; CHECK-NEXT:    br i1 [[ENTRY_COND]], label [[LOOP_PREHEADER:%.*]], label [[LOOP_EXIT:%.*]]
198; CHECK:       loop.preheader:
199; CHECK-NEXT:    br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
200; CHECK:       vector.ph:
201; CHECK-NEXT:    br label [[VECTOR_BODY:%.*]]
202; CHECK:       vector.body:
203; CHECK-NEXT:    [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
204; CHECK-NEXT:    [[VEC_PHI:%.*]] = phi <4 x float> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP8:%.*]], [[VECTOR_BODY]] ]
205; CHECK-NEXT:    [[VEC_PHI1:%.*]] = phi <4 x float> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP9:%.*]], [[VECTOR_BODY]] ]
206; CHECK-NEXT:    [[TMP0:%.*]] = add i32 [[INDEX]], 0
207; CHECK-NEXT:    [[TMP1:%.*]] = add i32 [[INDEX]], 4
208; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr float, float* [[ARRAY:%.*]], i32 [[TMP0]]
209; CHECK-NEXT:    [[TMP3:%.*]] = getelementptr float, float* [[ARRAY]], i32 [[TMP1]]
210; CHECK-NEXT:    [[TMP4:%.*]] = getelementptr float, float* [[TMP2]], i32 0
211; CHECK-NEXT:    [[TMP5:%.*]] = bitcast float* [[TMP4]] to <4 x float>*
212; CHECK-NEXT:    [[WIDE_LOAD:%.*]] = load <4 x float>, <4 x float>* [[TMP5]], align 4
213; CHECK-NEXT:    [[TMP6:%.*]] = getelementptr float, float* [[TMP2]], i32 4
214; CHECK-NEXT:    [[TMP7:%.*]] = bitcast float* [[TMP6]] to <4 x float>*
215; CHECK-NEXT:    [[WIDE_LOAD2:%.*]] = load <4 x float>, <4 x float>* [[TMP7]], align 4
216; CHECK-NEXT:    [[TMP8]] = fadd reassoc contract <4 x float> [[VEC_PHI]], [[WIDE_LOAD]]
217; CHECK-NEXT:    [[TMP9]] = fadd reassoc contract <4 x float> [[VEC_PHI1]], [[WIDE_LOAD2]]
218; CHECK-NEXT:    [[INDEX_NEXT]] = add i32 [[INDEX]], 8
219; CHECK-NEXT:    [[TMP10:%.*]] = icmp eq i32 [[INDEX_NEXT]], 4096
220; CHECK-NEXT:    br i1 [[TMP10]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], [[LOOP6:!llvm.loop !.*]]
221; CHECK:       middle.block:
222; CHECK-NEXT:    [[BIN_RDX:%.*]] = fadd reassoc contract <4 x float> [[TMP9]], [[TMP8]]
223; CHECK-NEXT:    [[TMP11:%.*]] = call reassoc contract float @llvm.vector.reduce.fadd.v4f32(float -0.000000e+00, <4 x float> [[BIN_RDX]])
224; CHECK-NEXT:    [[CMP_N:%.*]] = icmp eq i32 4096, 4096
225; CHECK-NEXT:    br i1 [[CMP_N]], label [[LOOP_EXIT_LOOPEXIT:%.*]], label [[SCALAR_PH]]
226; CHECK:       scalar.ph:
227; CHECK-NEXT:    [[BC_RESUME_VAL:%.*]] = phi i32 [ 4096, [[MIDDLE_BLOCK]] ], [ 0, [[LOOP_PREHEADER]] ]
228; CHECK-NEXT:    [[BC_MERGE_RDX:%.*]] = phi float [ 0.000000e+00, [[LOOP_PREHEADER]] ], [ [[TMP11]], [[MIDDLE_BLOCK]] ]
229; CHECK-NEXT:    br label [[LOOP:%.*]]
230; CHECK:       loop:
231; CHECK-NEXT:    [[IDX:%.*]] = phi i32 [ [[IDX_INC:%.*]], [[LOOP]] ], [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ]
232; CHECK-NEXT:    [[SUM:%.*]] = phi float [ [[SUM_INC:%.*]], [[LOOP]] ], [ [[BC_MERGE_RDX]], [[SCALAR_PH]] ]
233; CHECK-NEXT:    [[ADDRESS:%.*]] = getelementptr float, float* [[ARRAY]], i32 [[IDX]]
234; CHECK-NEXT:    [[VALUE:%.*]] = load float, float* [[ADDRESS]], align 4
235; CHECK-NEXT:    [[SUM_INC]] = fadd reassoc contract float [[SUM]], [[VALUE]]
236; CHECK-NEXT:    [[IDX_INC]] = add i32 [[IDX]], 1
237; CHECK-NEXT:    [[BE_COND:%.*]] = icmp ne i32 [[IDX_INC]], 4096
238; CHECK-NEXT:    br i1 [[BE_COND]], label [[LOOP]], label [[LOOP_EXIT_LOOPEXIT]], [[LOOP7:!llvm.loop !.*]]
239; CHECK:       loop.exit.loopexit:
240; CHECK-NEXT:    [[SUM_INC_LCSSA:%.*]] = phi float [ [[SUM_INC]], [[LOOP]] ], [ [[TMP11]], [[MIDDLE_BLOCK]] ]
241; CHECK-NEXT:    br label [[LOOP_EXIT]]
242; CHECK:       loop.exit:
243; CHECK-NEXT:    [[SUM_LCSSA:%.*]] = phi float [ 0.000000e+00, [[ENTRY:%.*]] ], [ [[SUM_INC_LCSSA]], [[LOOP_EXIT_LOOPEXIT]] ]
244; CHECK-NEXT:    ret float [[SUM_LCSSA]]
245;
246entry:
247  %entry.cond = icmp ne i32 0, 4096
248  br i1 %entry.cond, label %loop, label %loop.exit
249
250loop:
251  %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]
252  %sum = phi float [ 0.000000e+00, %entry ], [ %sum.inc, %loop ]
253  %address = getelementptr float, float* %array, i32 %idx
254  %value = load float, float* %address
255  %sum.inc = fadd reassoc contract float %sum, %value
256  %idx.inc = add i32 %idx, 1
257  %be.cond = icmp ne i32 %idx.inc, 4096
258  br i1 %be.cond, label %loop, label %loop.exit
259
260loop.exit:
261  %sum.lcssa = phi float [ %sum.inc, %loop ], [ 0.000000e+00, %entry ]
262  ret float %sum.lcssa
263}
264