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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 07:53:58 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;
----------------
preames wrote:

This line is incorrect.  The LMUL is already considered in the entry in the cost table.

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


More information about the llvm-commits mailing list