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

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


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

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


>From 1c516c4aeb05b7bb38e89a6640b35839a650ef1a Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Fri, 28 Mar 2025 13:22:17 +0000
Subject: [PATCH] [AMDGPU] Tweak address space definitions. NFC.

Define address spaces in numerical order. Fix comments to refer to
"local" instead of "group" address space.
---
 llvm/include/llvm/Support/AMDGPUAddrSpace.h | 2 +-
 llvm/lib/Target/AMDGPU/AMDGPU.h             | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

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},



More information about the llvm-commits mailing list