[PATCH] D64911: [AMDGPU] Extend the SI Load/Store optimizer

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 06:23:58 PDT 2019


nhaehnle added inline comments.


================
Comment at: lib/Target/AMDGPU/SILoadStoreOptimizer.cpp:322-325
+      if (AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vaddr) == -1)
+        return UNKNOWN;
+      if (!TII.get(Opc).mayLoad() || TII.isGather4(Opc))
+        return UNKNOWN;
----------------
This should probably check mayStore instead of mayLoad: we want to exclude both stores and atomics.

You could also move the check for TFE and LWE to here.


================
Comment at: lib/Target/AMDGPU/SILoadStoreOptimizer.cpp:1051
+  for (unsigned I = 1, E = (*CI.I).getNumOperands(); I != E; ++I) {
+    (I == DMaskIdx) ? MIB.addImm(MergedDMask) : MIB.add((*CI.I).getOperand(I));
+  }
----------------
Please use an if-statement.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64911





More information about the llvm-commits mailing list