Skip to content

Commit 8fe477c

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,10 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
10921092
case Intrinsic::smin:
10931093
case Intrinsic::smax: {
10941094
auto LT = getTypeLegalizationCost(RetTy);
1095-
if ((ST->hasVInstructions() && LT.second.isVector()) ||
1096-
(LT.second.isScalarInteger() && ST->hasStdExtZbb()))
1095+
if (ST->hasVInstructions() && LT.second.isVector())
10971096
return LT.first * TLI->getLMULCost(LT.second);
1097+
if (LT.second.isScalarInteger() && ST->hasStdExtZbb())
1098+
return LT.first;
10981099
break;
10991100
}
11001101
case Intrinsic::sadd_sat:

0 commit comments

Comments
 (0)