[llvm] [VPlan] Scalarize to first-lane-only directly on VPlan (PR #184267)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 01:50:44 PDT 2026


================
@@ -225,6 +225,31 @@ bool VPRecipeBase::mayHaveSideEffects() const {
   }
 }
 
+bool VPRecipeBase::isSafeToSpeculativelyExecute() const {
+  switch (getVPRecipeID()) {
+  default:
+    return false;
+  case VPInstructionSC: {
+    unsigned Opcode = cast<VPInstruction>(this)->getOpcode();
+    if (Instruction::isCast(Opcode))
+      return true;
+
+    switch (Opcode) {
+    default:
+      return false;
+    case Instruction::Add:
+    case Instruction::Sub:
+    case Instruction::Mul:
+    case Instruction::GetElementPtr:
+      return true;
+    }
+  }
+  case VPVectorPointerSC:
+  case VPVectorEndPointerSC:
+    return true;
----------------
fhahn wrote:

unused currently?

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


More information about the llvm-commits mailing list