[llvm] [InferAlignment] Fix updating alignment when larger than i32 (PR #160109)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 07:11:50 PDT 2025
================
@@ -57,7 +57,8 @@ static bool tryToImproveAlign(
cast<ConstantInt>(II->getArgOperand(AlignOpIdx))->getAlignValue();
Align PrefAlign = DL.getPrefTypeAlign(Type);
Align NewAlign = Fn(PtrOp, OldAlign, PrefAlign);
- if (NewAlign <= OldAlign)
+ if (NewAlign <= OldAlign ||
+ NewAlign.value() > std::numeric_limits<uint32_t>().max())
----------------
jhuber6 wrote:
I figured this was more straightforward since the problem is that Align is stored as `i64` but this argument is `i32`, so this makes it clear that it's a size issue.
https://github.com/llvm/llvm-project/pull/160109
More information about the llvm-commits
mailing list