Skip to content

Commit

Permalink
[RISCV] Only calculate ordered reduction with fp type. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvisWang123 committed Oct 30, 2024
1 parent b90ea5c commit d6b3e45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ RISCVTTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
}

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

0 comments on commit d6b3e45

Please sign in to comment.