[llvm] [VPlan] Consistently use (Part, 0) for first lane scalar values (PR #80271)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 04:11:46 PST 2024


================
@@ -279,11 +279,17 @@ Value *VPInstruction::generateInstruction(VPTransformState &State,
   Builder.SetCurrentDebugLocation(getDebugLoc());
 
   if (Instruction::isBinaryOp(getOpcode())) {
+    bool OnlyFirstLaneUsed = vputils::onlyFirstLaneUsed(this);
     if (Part != 0 && vputils::onlyFirstPartUsed(this))
-      return State.get(this, 0);
-
-    Value *A = State.get(getOperand(0), Part);
-    Value *B = State.get(getOperand(1), Part);
+      return OnlyFirstLaneUsed ? State.get(this, VPIteration(0, 0))
+                               : State.get(this, 0);
----------------
fhahn wrote:

Updated, thanks!

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


More information about the llvm-commits mailing list