[llvm] [VPlan] Add VPInstruction::Intrinsic opcode, use for scalar intrinsics. (PR #207541)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 12:02:32 PDT 2026


================
@@ -95,9 +95,14 @@ template <typename Ty> Intrinsic::ID getIntrinsicID(const Ty *R) {
       // The callee is the last operand, excluding the mask if predicated.
       return GetCalleeIntrinsic(
           Rep->getOperand(Rep->getNumOperandsWithoutMask() - 1));
-  if (const auto *VPI = dyn_cast<VPInstruction>(R))
+  if (const auto *VPI = dyn_cast<VPInstruction>(R)) {
     if (VPI->getOpcode() == Instruction::Call)
       return GetCalleeIntrinsic(VPI->getOperand(VPI->getNumOperands() - 1));
+    if (VPI->getOpcode() == VPInstruction::Intrinsic) {
+      return cast<VPConstantInt>(VPI->getOperand(VPI->getNumOperands() - 1))
+          ->getZExtValue();
+    }
----------------
artagnon wrote:

```suggestion
    if (VPI->getOpcode() == VPInstruction::Intrinsic)
      return cast<VPConstantInt>(VPI->getOperand(VPI->getNumOperands() - 1))
          ->getZExtValue();
```

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


More information about the llvm-commits mailing list