[PATCH] D73428: [Attributor] Improve `noalias` deduction based on memory information

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 26 10:23:32 PST 2020


xbolva00 added inline comments.


================
Comment at: llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll:22
 ; CHECK-NEXT:    store i32 [[X]], i32* [[X_ADDR]], align 4
-; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @deref(i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[X_ADDR]])
+; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @deref(i32* noalias nofree nonnull readonly align 4 dereferenceable(4) [[X_ADDR]])
 ; CHECK-NEXT:    ret i32 [[TMP1]]
----------------
jdoerfert wrote:
> xbolva00 wrote:
> > What happens here? We lost nocapture.
> We did not lose information ;)
> 
> On call sites we do not automatically derive every attribute, it is generally not needed. Before, we needed to know if the attribute was `nocapture` so we derived it for the call site as well. Now, we can get the `noalias` on `%x` in `@deref` without the `nocapture` so it is not manifested here. If you query it via the llvm API you would get it anyway because we marked the argument in `@deref`.
Ah, true. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73428





More information about the llvm-commits mailing list