[PATCH] D102215: [SelectionDAG] Propagate scoped AA metadata when lowering mem intrinsics.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 09:25:01 PDT 2021


hliao added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6361
             DAG.getMemBasePlusOffset(Dst, TypeSize::Fixed(DstOff), dl),
-            DstPtrInfo.getWithOffset(DstOff), Alignment, MMOFlags);
+            DstPtrInfo.getWithOffset(DstOff), Alignment, MMOFlags, AAInfo);
         OutChains.push_back(Store);
----------------
jeroen.dobbelaere wrote:
> IMHO, the expansion of the mem intrinsic should be responsible for only using the metadata that makes sense for it ?
> (If not, we should have an assertion to check that the AAInfo is sane).
> 
> `!alias.scope` and `!noalias` make sense, with the meaning: this memory instruction might alias with '!alias.scope` scopes, and will never alias with `!noalias` scopes.
>  `!tbaa` does not make sense (I think), but `!tbaa.struct` does. The expansion might make use of it, or leave away.
> 
That's reasonable. I just moved the preparation of that AAInfo into the lowering part from the builder. So far, scoped AA metadata are retained. But, TBAA ones are cleared so far. We may take advantage of tbaa.struct in the future to refine loads/stores generated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102215



More information about the llvm-commits mailing list