[llvm] r317051 - [AMDGPU] Clean up symbols in the global namespace.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 16:21:30 PDT 2017


Author: d0k
Date: Tue Oct 31 16:21:30 2017
New Revision: 317051

URL: http://llvm.org/viewvc/llvm-project?rev=317051&view=rev
Log:
[AMDGPU] Clean up symbols in the global namespace.

Modified:
    llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
    llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
    llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
    llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPU.h?rev=317051&r1=317050&r2=317051&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPU.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPU.h Tue Oct 31 16:21:30 2017
@@ -217,39 +217,44 @@ struct AMDGPUAS {
   unsigned FLAT_ADDRESS;     ///< Address space for flat memory.
   unsigned REGION_ADDRESS;   ///< Address space for region memory.
 
-  // The maximum value for flat, generic, local, private, constant and region.
-  const static unsigned MAX_COMMON_ADDRESS = 5;
-
-  const static unsigned GLOBAL_ADDRESS   = 1;  ///< Address space for global memory (RAT0, VTX0).
-  const static unsigned CONSTANT_ADDRESS = 2;  ///< Address space for constant memory (VTX2)
-  const static unsigned LOCAL_ADDRESS    = 3;  ///< Address space for local memory.
-  const static unsigned PARAM_D_ADDRESS  = 6;  ///< Address space for direct addressible parameter memory (CONST0)
-  const static unsigned PARAM_I_ADDRESS  = 7;  ///< Address space for indirect addressible parameter memory (VTX1)
-
-  // Do not re-order the CONSTANT_BUFFER_* enums.  Several places depend on this
-  // order to be able to dynamically index a constant buffer, for example:
-  //
-  // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx
-
-  const static unsigned CONSTANT_BUFFER_0 = 8;
-  const static unsigned CONSTANT_BUFFER_1 = 9;
-  const static unsigned CONSTANT_BUFFER_2 = 10;
-  const static unsigned CONSTANT_BUFFER_3 = 11;
-  const static unsigned CONSTANT_BUFFER_4 = 12;
-  const static unsigned CONSTANT_BUFFER_5 = 13;
-  const static unsigned CONSTANT_BUFFER_6 = 14;
-  const static unsigned CONSTANT_BUFFER_7 = 15;
-  const static unsigned CONSTANT_BUFFER_8 = 16;
-  const static unsigned CONSTANT_BUFFER_9 = 17;
-  const static unsigned CONSTANT_BUFFER_10 = 18;
-  const static unsigned CONSTANT_BUFFER_11 = 19;
-  const static unsigned CONSTANT_BUFFER_12 = 20;
-  const static unsigned CONSTANT_BUFFER_13 = 21;
-  const static unsigned CONSTANT_BUFFER_14 = 22;
-  const static unsigned CONSTANT_BUFFER_15 = 23;
-
-  // Some places use this if the address space can't be determined.
-  const static unsigned UNKNOWN_ADDRESS_SPACE = ~0u;
+  enum : unsigned {
+    // The maximum value for flat, generic, local, private, constant and region.
+    MAX_COMMON_ADDRESS = 5,
+
+    GLOBAL_ADDRESS = 1,   ///< Address space for global memory (RAT0, VTX0).
+    CONSTANT_ADDRESS = 2, ///< Address space for constant memory (VTX2)
+    LOCAL_ADDRESS = 3,    ///< Address space for local memory.
+    /// Address space for direct addressible parameter memory (CONST0)
+    PARAM_D_ADDRESS = 6,
+    /// Address space for indirect addressible parameter memory (VTX1)
+    PARAM_I_ADDRESS = 7,
+
+    // Do not re-order the CONSTANT_BUFFER_* enums.  Several places depend on
+    // this order to be able to dynamically index a constant buffer, for
+    // example:
+    //
+    // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx
+
+    CONSTANT_BUFFER_0 = 8,
+    CONSTANT_BUFFER_1 = 9,
+    CONSTANT_BUFFER_2 = 10,
+    CONSTANT_BUFFER_3 = 11,
+    CONSTANT_BUFFER_4 = 12,
+    CONSTANT_BUFFER_5 = 13,
+    CONSTANT_BUFFER_6 = 14,
+    CONSTANT_BUFFER_7 = 15,
+    CONSTANT_BUFFER_8 = 16,
+    CONSTANT_BUFFER_9 = 17,
+    CONSTANT_BUFFER_10 = 18,
+    CONSTANT_BUFFER_11 = 19,
+    CONSTANT_BUFFER_12 = 20,
+    CONSTANT_BUFFER_13 = 21,
+    CONSTANT_BUFFER_14 = 22,
+    CONSTANT_BUFFER_15 = 23,
+
+    // Some places use this if the address space can't be determined.
+    UNKNOWN_ADDRESS_SPACE = ~0u,
+  };
 };
 
 namespace llvm {

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.cpp?rev=317051&r1=317050&r2=317051&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.cpp Tue Oct 31 16:21:30 2017
@@ -544,6 +544,7 @@ unsigned SISubtarget::getMaxNumVGPRs(con
   return MaxNumVGPRs - getReservedNumVGPRs(MF);
 }
 
+namespace {
 struct MemOpClusterMutation : ScheduleDAGMutation {
   const SIInstrInfo *TII;
 
@@ -592,6 +593,7 @@ struct MemOpClusterMutation : ScheduleDA
     }
   }
 };
+} // namespace
 
 void SISubtarget::getPostRAMutations(
     std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp?rev=317051&r1=317050&r2=317051&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp Tue Oct 31 16:21:30 2017
@@ -324,7 +324,7 @@ static ImmutablePass *createAMDGPUExtern
 }
 
 /// Predicate for Internalize pass.
-bool mustPreserveGV(const GlobalValue &GV) {
+static bool mustPreserveGV(const GlobalValue &GV) {
   if (const Function *F = dyn_cast<Function>(&GV))
     return F->isDeclaration() || AMDGPU::isEntryFunctionCC(F->getCallingConv());
 

Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp?rev=317051&r1=317050&r2=317051&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Tue Oct 31 16:21:30 2017
@@ -816,29 +816,6 @@ bool isLegalSMRDImmOffset(const MCSubtar
 
 } // end namespace llvm
 
-const unsigned AMDGPUAS::MAX_COMMON_ADDRESS;
-const unsigned AMDGPUAS::GLOBAL_ADDRESS;
-const unsigned AMDGPUAS::LOCAL_ADDRESS;
-const unsigned AMDGPUAS::PARAM_D_ADDRESS;
-const unsigned AMDGPUAS::PARAM_I_ADDRESS;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_0;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_1;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_2;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_3;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_4;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_5;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_6;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_7;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_8;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_9;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_10;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_11;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_12;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_13;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_14;
-const unsigned AMDGPUAS::CONSTANT_BUFFER_15;
-const unsigned AMDGPUAS::UNKNOWN_ADDRESS_SPACE;
-
 namespace llvm {
 namespace AMDGPU {
 




More information about the llvm-commits mailing list