[llvm-branch-commits] [llvm] [AMDGPU] Price memory operations by the number of memory instructions (PR #233261)

Dmitry Sidorov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 19 03:16:06 PDT 2026


================
@@ -2115,22 +2115,89 @@ GCNTTIImpl::fpenvIEEEMode(const Instruction &I) const {
                                                : KnownIEEEMode::On;
 }
 
+static unsigned getNumMemoryInsts(unsigned Bytes, unsigned MaxBytes,
+                                  bool HasDwordx3) {
+  unsigned NumInsts = Bytes / MaxBytes;
+  unsigned Rem = Bytes % MaxBytes;
+  if (HasDwordx3 && Rem >= 12) {
----------------
MrSidims wrote:

SILoadStoreOptimizer merges 8+4 into dwordx3 for global and flat. But indeed, for LDS and scratch it's a bit more tricker, will correct the check.

https://github.com/llvm/llvm-project/pull/233261


More information about the llvm-branch-commits mailing list