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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 08:05:51 PST 2024


================
@@ -1163,7 +1165,7 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     auto LT = getTypeLegalizationCost(RetTy);
     if (const auto *Entry = CostTableLookup(VectorIntrinsicCostTable,
                                             ICA.getID(), LT.second))
-      return LT.first * Entry->Cost;
+      return LT.first * TLI->getLMULCost(LT.second) * Entry->Cost;
----------------
lukel97 wrote:

I guess we can't exactly tell what percentage of instructions that make up the cost actually need to be scaled by LMUL. Would it be safe to say though that most of them are vector instructions that read and write full vector groups?

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


More information about the llvm-commits mailing list