[llvm] [VPlan] Factor first-lane-scalar logic in VPI::execute (NFC) (PR #196207)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 03:32:06 PDT 2026


================
@@ -1568,20 +1563,18 @@ void VPInstruction::execute(VPTransformState &State) {
   assert(hasRequiredFlagsForOpcode(getOpcode()) &&
          "Opcode requires specific flags to be set");
   State.Builder.setFastMathFlags(getFastMathFlagsOrNone());
-  Value *GeneratedValue = generate(State);
+  bool GenerateScalar =
+      State.VF.isScalar() || (canGenerateScalarForFirstLane() &&
+                              (vputils::onlyFirstLaneUsed(this) ||
----------------
lukel97 wrote:

I don't think it's about the implementation of isSingleScalar but the fact that calls to State.get can now be affected by isSingleScalar, not just vputils::onlyFirstLaneUsed

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


More information about the llvm-commits mailing list