diff --git a/llvm/test/CodeGen/RISCV/rvv/fold-binary-reduce.ll b/llvm/test/CodeGen/RISCV/rvv/fold-binary-reduce.ll --- a/llvm/test/CodeGen/RISCV/rvv/fold-binary-reduce.ll +++ b/llvm/test/CodeGen/RISCV/rvv/fold-binary-reduce.ll @@ -252,8 +252,9 @@ ; CHECK-NEXT: vfmv.f.s fa0, v8 ; CHECK-NEXT: ret entry: - %rdx = call fast float @llvm.vector.reduce.fadd.v4f32(float %x, <4 x float> %v) - ret float %rdx + %rdx = call fast float @llvm.vector.reduce.fadd.v4f32(float 0.0, <4 x float> %v) + %res = fadd reassoc nsz float %rdx, %x + ret float %res } define float @reduce_fmax(float %x, <4 x float> %v) {