Skip to content

Commit d6b3e45

Browse files
committed
[RISCV] Only calculate ordered reduction with fp type. NFC
1 parent b90ea5c commit d6b3e45

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
@@ -1552,7 +1552,7 @@ RISCVTTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
15521552
}
15531553

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

0 commit comments

Comments
 (0)