[llvm] [AMDGPU] Tweak address space definitions. NFC. (PR #133442)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 28 06:24:39 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Jay Foad (jayfoad)

<details>
<summary>Changes</summary>

Define address spaces in numerical order. Fix comments to refer to
"local" instead of "group" address space.


---
Full diff: https://github.com/llvm/llvm-project/pull/133442.diff


2 Files Affected:

- (modified) llvm/include/llvm/Support/AMDGPUAddrSpace.h (+1-1) 
- (modified) llvm/lib/Target/AMDGPU/AMDGPU.h (+2-2) 


``````````diff
diff --git a/llvm/include/llvm/Support/AMDGPUAddrSpace.h b/llvm/include/llvm/Support/AMDGPUAddrSpace.h
index a7533b99a8441..b1b1dd49a2c4a 100644
--- a/llvm/include/llvm/Support/AMDGPUAddrSpace.h
+++ b/llvm/include/llvm/Support/AMDGPUAddrSpace.h
@@ -31,8 +31,8 @@ enum : unsigned {
   GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0).
   REGION_ADDRESS = 2, ///< Address space for region memory. (GDS)
 
-  CONSTANT_ADDRESS = 4, ///< Address space for constant memory (VTX2).
   LOCAL_ADDRESS = 3,    ///< Address space for local memory.
+  CONSTANT_ADDRESS = 4, ///< Address space for constant memory (VTX2).
   PRIVATE_ADDRESS = 5,  ///< Address space for private memory.
 
   CONSTANT_ADDRESS_32BIT = 6, ///< Address space for 32-bit constant memory.
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.h b/llvm/lib/Target/AMDGPU/AMDGPU.h
index 00a807192eb0c..a8e4ea9429f50 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.h
@@ -537,11 +537,11 @@ static inline bool addrspacesMayAlias(unsigned AS1, unsigned AS2) {
   // This array is indexed by address space value enum elements 0 ... to 9
   // clang-format off
   static const bool ASAliasRules[10][10] = {
-    /*                       Flat   Global Region  Group Constant Private Const32 BufFatPtr BufRsrc BufStrdPtr */
+    /*                       Flat   Global Region  Local Constant Private Const32 BufFatPtr BufRsrc BufStrdPtr */
     /* Flat     */            {true,  true,  false, true,  true,  true,  true,  true,  true,  true},
     /* Global   */            {true,  true,  false, false, true,  false, true,  true,  true,  true},
     /* Region   */            {false, false, true,  false, false, false, false, false, false, false},
-    /* Group    */            {true,  false, false, true,  false, false, false, false, false, false},
+    /* Local    */            {true,  false, false, true,  false, false, false, false, false, false},
     /* Constant */            {true,  true,  false, false, false, false, true,  true,  true,  true},
     /* Private  */            {true,  false, false, false, false, true,  false, false, false, false},
     /* Constant 32-bit */     {true,  true,  false, false, true,  false, false, true,  true,  true},

``````````

</details>


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


More information about the llvm-commits mailing list