[llvm] [VPlan] Use pointer to member 0 as VPInterleaveRecipe's pointer arg. (PR #106431)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 10:01:21 PDT 2024


================
@@ -646,7 +646,9 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
            "can only generate first lane for PtrAdd");
     Value *Ptr = State.get(getOperand(0), Part, /* IsScalar */ true);
     Value *Addend = State.get(getOperand(1), Part, /* IsScalar */ true);
-    return Builder.CreatePtrAdd(Ptr, Addend, Name);
+    return Builder.CreatePtrAdd(Ptr, Addend, Name,
+                                isInBounds() ? GEPNoWrapFlags::inBounds()
+                                             : GEPNoWrapFlags::none());
----------------
ayalz wrote:

```suggestion
    auto Flags = isInBounds() ? GEPNoWrapFlags::inBounds()
                              : GEPNoWrapFlags::none());
    return Builder.CreatePtrAdd(Ptr, Addend, Name, Flags);
```
?

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


More information about the llvm-commits mailing list