[PATCH] D71499: Add builtins for aligning and checking alignment of pointers and integers

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 2 01:03:33 PST 2020


lebedev.ri added a comment.

In D71499#1800636 <https://reviews.llvm.org/D71499#1800636>, @arichardson wrote:

> Address feedback: Avoid inttoptr by using ptrtoint + GEP instead.
>
> Using two GEPs for align_up seems to generate better code than select + a single GEP.
>  See https://godbolt.org/z/UdPjZk


Avoiding `select` is good, true. But we can do better with a single `gep` still:
https://godbolt.org/z/u7YHKw


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71499/new/

https://reviews.llvm.org/D71499





More information about the cfe-commits mailing list