[llvm] [WIP][RISCV] Tune flag for fast vrgather.vv (PR #124664)
Petr Penzin via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 08:19:26 PST 2025
================
@@ -2848,6 +2848,11 @@ InstructionCost RISCVTargetLowering::getLMULCost(MVT VT) const {
/// is generally quadratic in the number of vreg implied by LMUL. Note that
/// operand (index and possibly mask) are handled separately.
InstructionCost RISCVTargetLowering::getVRGatherVVCost(MVT VT) const {
+ auto LMULCost = getLMULCost(VT);
+ if (Subtarget.hasFastVRGather() && LMULCost.isValid()) {
+ unsigned Log = Log2_64(*LMULCost.getValue());
+ return LMULCost * Log;
+ }
return getLMULCost(VT) * getLMULCost(VT);
----------------
ppenzin wrote:
Good point, addressed
https://github.com/llvm/llvm-project/pull/124664
More information about the llvm-commits
mailing list