You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you round up a pointer and calculate how far it moved from the original pointer (((p + (a-1)) & -a) - p), that distance is always less than the alignment: https://alive2.llvm.org/ce/z/fL_uXq
If you round up a pointer and calculate how far it moved from the original pointer (
((p + (a-1)) & -a) - p
), that distance is always less than the alignment: https://alive2.llvm.org/ce/z/fL_uXqBut it appears that optimizations can't take advantage of that today https://llvm.godbolt.org/z/Mcc7ads1j, not even for constant alignment.
(Found trying to use https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.align_offset in Rust, when I noticed unnecessary checks.)
The text was updated successfully, but these errors were encountered: