[AMDGPU] Clean up symbols in the global namespace.

llvm-svn: 317051
This commit is contained in:
Benjamin Kramer 2017-10-31 23:21:30 +00:00
parent 7db6f7a344
commit f9ab3ddb8f
4 changed files with 37 additions and 53 deletions

View File

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

View File

@ -544,6 +544,7 @@ unsigned SISubtarget::getMaxNumVGPRs(const MachineFunction &MF) const {
return MaxNumVGPRs - getReservedNumVGPRs(MF); return MaxNumVGPRs - getReservedNumVGPRs(MF);
} }
namespace {
struct MemOpClusterMutation : ScheduleDAGMutation { struct MemOpClusterMutation : ScheduleDAGMutation {
const SIInstrInfo *TII; const SIInstrInfo *TII;
@ -592,6 +593,7 @@ struct MemOpClusterMutation : ScheduleDAGMutation {
} }
} }
}; };
} // namespace
void SISubtarget::getPostRAMutations( void SISubtarget::getPostRAMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const { std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {

View File

@ -324,7 +324,7 @@ static ImmutablePass *createAMDGPUExternalAAWrapperPass() {
} }
/// Predicate for Internalize pass. /// Predicate for Internalize pass.
bool mustPreserveGV(const GlobalValue &GV) { static bool mustPreserveGV(const GlobalValue &GV) {
if (const Function *F = dyn_cast<Function>(&GV)) if (const Function *F = dyn_cast<Function>(&GV))
return F->isDeclaration() || AMDGPU::isEntryFunctionCC(F->getCallingConv()); return F->isDeclaration() || AMDGPU::isEntryFunctionCC(F->getCallingConv());

View File

@ -816,29 +816,6 @@ bool isLegalSMRDImmOffset(const MCSubtargetInfo &ST, int64_t ByteOffset) {
} // end namespace llvm } // 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 llvm {
namespace AMDGPU { namespace AMDGPU {