[PATCH] D149986: AMDGPU: Force sc0 and sc1 on stores for gfx940 and gfx941

Scott Linder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 11:37:07 PDT 2023


scott.linder added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp:517-529
+  bool tryForceStoreSC0SC1(const SIMemOpInfo &MOI,
+                           MachineBasicBlock::iterator &MI) const override {
+    if (ST.hasForceStoreSC0SC1() &&
+        (MOI.getInstrAddrSpace() & (SIAtomicAddrSpace::SCRATCH |
+                                    SIAtomicAddrSpace::GLOBAL |
+                                    SIAtomicAddrSpace::OTHER)) !=
+         SIAtomicAddrSpace::NONE) {
----------------
It may be a bit more verbose, but I would suggest just having a `bool Changed` variable, like other (admittedly more complicated) functions in the unit do. I don't think any future maintainer will mis-interpret this, even without the comment


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

https://reviews.llvm.org/D149986



More information about the cfe-commits mailing list