[PATCH] D100785: [InstCombine] Enhance deduction of alignment for aligned_alloc

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 12:49:57 PDT 2021


xbolva00 added a comment.

In D100785#2699460 <https://reviews.llvm.org/D100785#2699460>, @jdoerfert wrote:

>> The function aligned_alloc() is the same as memalign(), except for the added restriction that size should be a multiple of alignment. So for a non-zero alignment size need to be non-zero.
>
> I don't think the last part is true, 0 x Alignment = 0. That said, for non-zero sizes we know alignment holds, so this is fine.

So should we just drop isKnownNonZero check? To allow annotation for case like aligned_alloc(32, dynamicsize)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100785



More information about the llvm-commits mailing list