[PATCH] D108315: [AMDGPU] Add alias.scope metadata to lowered LDS struct

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 18 14:57:18 PDT 2021


rampitec added a comment.

In D108315#2953206 <https://reviews.llvm.org/D108315#2953206>, @arsenm wrote:

> What happens if the original accesses had alias metadata? Can you add a case where it already has alias.scope, plus tbaa?

Actually concatenating metadata is wrong. For alias.scope correct correct merging method is `MDNode::getMostGenericAliasScope()` and for noalias `intersect`. Both methods however create more pessimistic metadata than before the merge, so if we have any of scoped alias metadata it seems better to just leave it alone.

TBAA is not affected at all. Tests added.



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:294
+      for (size_t I = 0; I < LocalVars.size(); I++) {
+        MDNode *Domain = MDB.createAnonymousAliasScopeDomain();
+        MDNode *Scope = MDB.createAnonymousAliasScope(Domain);
----------------
bcahoon wrote:
> Is a different domain needed for each variable/field, or can just one domain be created?
A single domain works, thanks!


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

https://reviews.llvm.org/D108315



More information about the llvm-commits mailing list