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

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 10 22:07:22 PST 2023


================
@@ -1092,7 +1093,7 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     auto LT = getTypeLegalizationCost(RetTy);
     if ((ST->hasVInstructions() && LT.second.isVector()) ||
         (LT.second.isScalarInteger() && ST->hasStdExtZbb()))
----------------
ShivaChen wrote:

Change to 
```
 if (ST->hasVInstructions() && LT.second.isVector())
    return LT.first * TLI->getLMULCost(LT.second);
 else if (LT.second.isScalarInteger() && ST->hasStdExtZbb())
    return LT.first;
```

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


More information about the llvm-commits mailing list