[llvm] [RISCV][CostModel][NFC] Add getRISCVInstructionCost() to TTI for Cost… (PR #73651)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 14:35:56 PST 2023


================
@@ -387,7 +446,12 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
         //   vsetivli zero, 2, e8, mf8, ta, ma (ignored)
         //   vmv.v.x v8, a0
         //   vmsne.vi v0, v8, 0
-        return LT.first * TLI->getLMULCost(LT.second) * 3;
+        return LT.first *
+               (TLI->getLMULCost(LT.second) + // FIXME: should be 1 for andi
+                getRISCVInstructionCost(RISCVInstruction::VMV, LT.second, 1,
----------------
topperc wrote:

RISCVInstruction::VMV seems to be used for different instruction here and on line 434. Line 434 uses it for vmv.s.x which is an operation that doesn't use LMUL. This code uses it for vmv.v.v which does use LMUL.

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


More information about the llvm-commits mailing list