[llvm] [VPlan] Use VPWidenIntrinsicRecipe to vp.select. (PR #110489)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 10:21:31 PDT 2024


================
@@ -4392,11 +4392,17 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
       OS << "):";
       if (Opcode == Instruction::Call) {
         auto *WidenCall = dyn_cast<VPWidenCallRecipe>(R);
-        Function *CalledFn =
-            WidenCall ? WidenCall->getCalledScalarFunction()
-                      : cast<Function>(R->getOperand(R->getNumOperands() - 1)
-                                           ->getLiveInIRValue());
-        OS << " call to " << CalledFn->getName();
+        StringRef Name = "";
+        if (auto *Int = dyn_cast<VPWidenIntrinsicRecipe>(R))
+          Name = Int->getIntrinsicName();
+        else {
----------------
alexey-bataev wrote:

```suggestion
        if (auto *Int = dyn_cast<VPWidenIntrinsicRecipe>(R)) {
          Name = Int->getIntrinsicName();
        } else {
```

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


More information about the llvm-commits mailing list