[llvm] [AMDGPU] Add support for store to constant address space (PR #153835)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 09:55:04 PDT 2025


================
@@ -1873,15 +1873,23 @@ bool SITargetLowering::isLegalAddressingMode(const DataLayout &DL,
 
 bool SITargetLowering::canMergeStoresTo(unsigned AS, EVT MemVT,
                                         const MachineFunction &MF) const {
-  if (AS == AMDGPUAS::GLOBAL_ADDRESS || AS == AMDGPUAS::FLAT_ADDRESS)
-    return (MemVT.getSizeInBits() <= 4 * 32);
-  if (AS == AMDGPUAS::PRIVATE_ADDRESS) {
+  switch (AS) {
+  default:
+    return true;
+  case AMDGPUAS::GLOBAL_ADDRESS:
+  case AMDGPUAS::FLAT_ADDRESS:
+  case AMDGPUAS::CONSTANT_ADDRESS:
+  case AMDGPUAS::CONSTANT_ADDRESS_32BIT:
+    return MemVT.getSizeInBits() <= 4 * 32;
----------------
shiltian wrote:

I removed this part, as well as the test cases. I put a FIXME there and we can revisit this after that is fixed.

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


More information about the llvm-commits mailing list