[PATCH] D96643: [AMDGPU] Limit memory scope for scratch and LDS

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 13 01:31:20 PST 2021


rampitec accepted this revision.
rampitec added a comment.
This revision is now accepted and ready to land.

LGTM, thanks Tony!
It is up to you to use min() or if(). I will postpone my patch to rebase on top your change as I expect to have zero test changes with my patch after this one and want to make sure this expectation is correct.



================
Comment at: llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp:143
+    case SIAtomicAddrSpace::SCRATCH:
+      if (Scope > SIAtomicScope::SINGLETHREAD)
+        this->Scope = SIAtomicScope::SINGLETHREAD;
----------------
Scope = std::min(Scope, SIAtomicScope::SINGLETHREAD) ?
It just looks more formal.


================
Comment at: llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp:147
+    case SIAtomicAddrSpace::LDS:
+      if (Scope > SIAtomicScope::WORKGROUP)
+        this->Scope = SIAtomicScope::WORKGROUP;
----------------
Same here. Up to you though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96643



More information about the llvm-commits mailing list