================
@@ -489,6 +490,23 @@ Value *VPInstruction::generateInstruction(VPTransformState 
&State,
 
     return ReducedPartRdx;
   }
+  case VPInstruction::PtrAdd: {
+    if (vputils::onlyFirstLaneUsed(this)) {
+      auto *P = Builder.CreatePtrAdd(
+          State.get(getOperand(0), VPIteration(Part, 0)),
+          State.get(getOperand(1), VPIteration(Part, 0)), Name);
+      State.set(this, P, VPIteration(Part, 0));
+    } else {
+      for (unsigned Lane = 0; Lane != State.VF.getKnownMinValue(); ++Lane) {
+        Value *P = Builder.CreatePtrAdd(
+            State.get(getOperand(0), VPIteration(Part, Lane)),
+            State.get(getOperand(1), VPIteration(Part, Lane)), Name);
+
+        State.set(this, P, VPIteration(Part, Lane));
+      }
+    }
+    return nullptr;
----------------
ayalz wrote:

Better for generateInstruction() to continue generate and return a single 
per-part Value, which is then set in State, possibly renaming it 
generateValuePerPart(), and have a separate generateValuePerLane() - currently 
to be invoked only for PtrAdd having all lanes used?

https://github.com/llvm/llvm-project/pull/80273
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to