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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 19:50:08 PDT 2025


================
@@ -5339,6 +5339,22 @@ struct AAPotentialConstantValues
     return nullptr;
   }
 
+  /// Return the minimum alignment of potential constants
+  Align getMinAlignment() const {
+    unsigned TrailingZeros = getAssumedSet().begin()->getBitWidth();
+    for (const APInt &It : getAssumedSet())
+      if (It.countTrailingZeros() < TrailingZeros)
+        TrailingZeros = It.countTrailingZeros();
+    return Align(1 << TrailingZeros);
+  }
+  /// Return the minimum alignment of potential constants
+  unsigned getAssumedMinTrailingZeros() const {
+    unsigned TrailingZeros = getAssumedSet().begin()->getBitWidth();
+    for (const APInt &It : getAssumedSet())
----------------
arsenm wrote:

Braces 

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


More information about the llvm-commits mailing list