[llvm] [Analysis] Enchance alignment propagation in computeKnownBits. (PR #171828)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 11 11:35:32 PST 2025
nikic wrote:
I'm not sure it makes sense to extend InferAlign beyond what it handles now. Once we go beyond ptrtoint + and, there's a lot of possible patterns to handle, and hardcoding them all is not scalable.
On the other hand, doing this in ValueTracking in a way that has little compile-time impact will also be unreliable, as we'll have to severely restrict the number of visited uses.
Probably the ideal solution here is to have something like `align` attribute/metadata on `ptrtoint` so we can infer that once and then computeKnownBits can use the computed value. But that's a more complex change...
https://github.com/llvm/llvm-project/pull/171828
More information about the llvm-commits
mailing list