[llvm] [Attributor] Propagate alignment through ptrmask (PR #150158)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 21:20:37 PDT 2025


================
@@ -5501,6 +5550,15 @@ struct AAAlignCallSiteReturned final
   AAAlignCallSiteReturned(const IRPosition &IRP, Attributor &A)
       : Base(IRP, A) {}
 
+  ChangeStatus updateImpl(Attributor &A) override {
+    Instruction *I = getIRPosition().getCtxI();
+    if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
+      Align Align = getAssumedAlignForIntrinsic(A, *this, *II);
+      return clampStateAndIndicateChange<StateType>(this->getState(),
+                                                    Align.value());
+    }
+    return Base::updateImpl(A);
----------------
shiltian wrote:

I'm lost here. `1 << 0` is also `Align(1)` right? `Align(1)` is the worst alignment anyway.

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


More information about the llvm-commits mailing list