[llvm] [Attributor] Guard alignment query after pointer-vector stripping (PR #205389)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 18:39:51 PDT 2026


================
@@ -5339,7 +5340,9 @@ struct AAAlignImpl : AAAlign {
     ChangeStatus Changed = AAAlign::manifest(A);
 
     Align InheritAlign =
-        getAssociatedValue().getPointerAlignment(A.getDataLayout());
+        getAssociatedValue().getType()->isPointerTy()
+            ? getAssociatedValue().getPointerAlignment(A.getDataLayout())
+            : Align(1);
     if (InheritAlign >= getAssumedAlign())
       return InstrChanged;
     return Changed | InstrChanged;
----------------
jdoerfert wrote:

We should never create a AAlign on a non-ptr typed value, right? So if we do, we need to fix that. And if we never do it, getAssociatedValue should always be ptr typed, right?

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


More information about the llvm-commits mailing list