[llvm] cc99bdd - AMDGPU: Avoid using hardcoded address space number

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 02:15:50 PDT 2024


Author: Matt Arsenault
Date: 2024-10-09T13:15:35+04:00
New Revision: cc99bddb71738761bfe21490f3b6853da036cf97

URL: https://github.com/llvm/llvm-project/commit/cc99bddb71738761bfe21490f3b6853da036cf97
DIFF: https://github.com/llvm/llvm-project/commit/cc99bddb71738761bfe21490f3b6853da036cf97.diff

LOG: AMDGPU: Avoid using hardcoded address space number

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
index 3afefcf55d498b..6e878a97018760 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp
@@ -87,7 +87,7 @@ static void createInitOrFiniCalls(Function &F, bool IsCtor) {
             /*Initializer=*/nullptr,
             IsCtor ? "__init_array_start" : "__fini_array_start",
             /*InsertBefore=*/nullptr, GlobalVariable::NotThreadLocal,
-            /*AddressSpace=*/1);
+            /*AddressSpace=*/AMDGPUAS::GLOBAL_ADDRESS);
       });
   auto *End = M.getOrInsertGlobal(
       IsCtor ? "__init_array_end" : "__fini_array_end",
@@ -98,7 +98,7 @@ static void createInitOrFiniCalls(Function &F, bool IsCtor) {
             /*Initializer=*/nullptr,
             IsCtor ? "__init_array_end" : "__fini_array_end",
             /*InsertBefore=*/nullptr, GlobalVariable::NotThreadLocal,
-            /*AddressSpace=*/1);
+            /*AddressSpace=*/AMDGPUAS::GLOBAL_ADDRESS);
       });
 
   // The constructor type is suppoed to allow using the argument vectors, but


        


More information about the llvm-commits mailing list