================
@@ -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;
----------------
fhahn wrote:

Updated to split into generate for scalars (per lane, possibly optimizing 
depending on onlyFirstLaneUseD) and generate for vectors (per-part)

Some of it could be done separately or as part of 
https://github.com/llvm/llvm-project/pull/80271, but would be good to agree on 
the overall structure first then land separately as makes sense.

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