[libc-commits] [libc] [libc] Add helper function for aligning pointers and values (PR #183324)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Wed Feb 25 09:24:31 PST 2026


vonosmas wrote:

FWIW I'm in favor of unification, but I find the difference between "align_up" and "align_to" overloads confusing, and the lack of compile-time checks (I suspect we don't want runtime asserts for performance reasons) makes it even harder... Will the compiler be smart enough to pick builtins or use bitwise operations when the alignment value is a power of two (I'd hope so). Do we have cases when compiler won't know the alignment value in advance and emit divisions, but in practice it would always be powers of two?

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


More information about the libc-commits mailing list