[llvm] [LV] Remove legacy setVectorizedCallDecision & co (NFC). (PR #195519)

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 09:13:03 PDT 2026


diggerlin wrote:

   there is hit assert i
   
   bash> cat reduced.ll
```
target datalayout = "E-m:a-Fi64-i64:64-i128:128-n32:64-f64:32:64-S128-v256:256:256-v512:512:512"
target triple = "powerpc64-ibm-aix7.3.0.0"

; Function Attrs: optsize
define void @_ZNK6dealii13QGaussLobattoILi1EE25compute_quadrature_pointsEjii(i64 %wide.trip.count) #0 {
entry:
  br label %for.body

for.body24.lr.ph:                                 ; preds = %for.body
  ret void

for.body:                                         ; preds = %for.body, %entry
  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
  %0 = tail call double @llvm.cos.f64(double 0.000000e+00) #2
  %fneg = fneg double %0
  store double %fneg, ptr null, align 4
  %indvars.iv.next = add i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count
  br i1 %exitcond.not, label %for.body24.lr.ph, label %for.body
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.cos.f64(double) #1

declare <2 x double> @__cosd2()

attributes #0 = { optsize }
attributes #1 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "vector-function-abi-variant"="_ZGV_LLVM_N2v_llvm.cos.f64(__cosd2)" }
```

$ opt -passes=loop-vectorize reduced.ll -o opt.ll


```
VF.isScalar() =0 , hasVectorLibraryVariantFor=1
opt: /home/zhijian/llvm/dev/digger-llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2136: InstructionCost llvm::LoopVectorizationCostModel::getVectorCallCost(CallInst *, ElementCount) const: Assertion `(VF.isScalar() || !hasVectorLibraryVariantFor(*CI, VF, isMaskRequired(CI), TLI)) && "getVectorCallCost does not price vector library variants"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
```

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


More information about the llvm-commits mailing list