Skip to content

Commit 74d6d68

Browse files
committed
[RISCV] Only calculate ordered reduction with fp type. NFC
1 parent 3243e3d commit 74d6d68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ RISCVTTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
15641564
}
15651565

15661566
// IR Reduction is composed by two vmv and one rvv reduction instruction.
1567-
if (TTI::requiresOrderedReduction(FMF)) {
1567+
if (TTI::requiresOrderedReduction(FMF) && ElementTy->isFloatingPointTy()) {
15681568
Opcodes.push_back(RISCV::VFMV_S_F);
15691569
for (unsigned i = 0; i < LT.first.getValue(); i++)
15701570
Opcodes.push_back(RISCV::VFREDOSUM_VS);

0 commit comments

Comments
 (0)