[llvm] [RISCV] Fix crash when unrolling loop containing vector instructions (PR #83384)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 04:03:22 PST 2024


================
@@ -37,6 +37,9 @@ static cl::opt<unsigned> SLPMaxVF(
 InstructionCost
 RISCVTTIImpl::getRISCVInstructionCost(ArrayRef<unsigned> OpCodes, MVT VT,
                                       TTI::TargetCostKind CostKind) {
+  // Check if the type is valid for all CostKind
+  if (!VT.isVector())
+    return InstructionCost::getInvalid();
----------------
lukel97 wrote:

Where is this getting called from with a scalar MVT? I would have thought that after scalarization we wouldn't have any vector instructions that would still be calling into this

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


More information about the llvm-commits mailing list