Skip to content

Commit 223e5ae

Browse files
committed
fixup! [RISCV] Fix missing scaling by LMUL in cost model
1 parent 8fe477c commit 223e5ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,10 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
11531153
case Intrinsic::vp_roundtozero: {
11541154
// Rounding with static rounding mode needs two more instructions to
11551155
// swap/write FRM than vp_rint.
1156-
unsigned Cost = 7;
11571156
auto LT = getTypeLegalizationCost(RetTy);
11581157
unsigned VPISD = getISDForVPIntrinsicID(ICA.getID());
11591158
if (TLI->isOperationCustom(VPISD, LT.second))
1160-
return Cost * LT.first * TLI->getLMULCost(LT.second);
1159+
return 5 * LT.first * TLI->getLMULCost(LT.second) + 2;
11611160
break;
11621161
}
11631162
}

0 commit comments

Comments
 (0)