[llvm] [llvm][RISCV] Do not assume V extension on seeing vector type. (PR #166994)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 11:03:12 PST 2025
================
@@ -2140,8 +2140,9 @@ InstructionCost RISCVTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
// Assume memory ops cost scale with the number of vector registers
// possible accessed by the instruction. Note that BasicTTI already
// handles the LT.first term for us.
- if (LT.second.isVector() && CostKind != TTI::TCK_CodeSize)
- BaseCost *= TLI->getLMULCost(LT.second);
+ if (TLI->getSubtarget().hasVInstructions())
+ if (LT.second.isVector() && CostKind != TTI::TCK_CodeSize)
----------------
topperc wrote:
Combine the 2 `if` conditions with `&&` instead of nesting
https://github.com/llvm/llvm-project/pull/166994
More information about the llvm-commits
mailing list