[llvm] [RISCV] Fix missing scaling by LMUL in cost model (PR #73342)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 00:01:48 PST 2023


================
@@ -438,7 +438,8 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
     InstructionCost GatherCost = 2 + TLI->getVRGatherVVCost(LT.second);
     // Mask operation additionally required extend and truncate
     InstructionCost ExtendCost = Tp->getElementType()->isIntegerTy(1) ? 3 : 0;
-    return LT.first * (LenCost + GatherCost + ExtendCost);
+    return LT.first * TLI->getLMULCost(LT.second) *
+           (LenCost + GatherCost + ExtendCost);
----------------
ShivaChen wrote:

It seems GatherCost has consider LMUL.

https://github.com/llvm/llvm-project/pull/73342


More information about the llvm-commits mailing list