[llvm-branch-commits] [llvm] [AMDGPU] Price constant address space memory operations (PR #238840)
Dmitry Sidorov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Nov 5 02:15:50 PST 2026
================
@@ -2172,13 +2172,47 @@ static unsigned getNumMemoryInsts(unsigned Bytes, unsigned MaxBytes,
bool HasDwordx3) {
unsigned NumInsts = Bytes / MaxBytes;
unsigned Rem = Bytes % MaxBytes;
- if (HasDwordx3 && Rem >= 12) {
+ if (HasDwordx3 && Rem % 16 >= 12) {
++NumInsts;
Rem -= 12;
}
return NumInsts + llvm::popcount(Rem);
}
+static unsigned getNumWidenedSMEMLoads(unsigned Bytes, uint64_t Alignment,
+ unsigned EltBytes, unsigned MaxBytes,
+ bool HasDwordx3) {
+ unsigned MaxPiece = EltBytes == 1 ? 8 : MaxBytes;
----------------
MrSidims wrote:
Actually, hold on, I'll check something.
https://github.com/llvm/llvm-project/pull/238840
More information about the llvm-branch-commits
mailing list