diff --git a/llvm/lib/Target/AMDGPU/SIDefines.h b/llvm/lib/Target/AMDGPU/SIDefines.h --- a/llvm/lib/Target/AMDGPU/SIDefines.h +++ b/llvm/lib/Target/AMDGPU/SIDefines.h @@ -29,6 +29,24 @@ RegKindMask = (HasVGPR | HasAGPR | HasSGPR) }; // enum SIRCFlagsr +namespace SIEncodingFamily { +// This must be kept in sync with the SIEncodingFamily class in SIInstrInfo.td +// and the columns of the getMCOpcodeGen table. +enum { + SI = 0, + VI = 1, + SDWA = 2, + SDWA9 = 3, + GFX80 = 4, + GFX9 = 5, + GFX10 = 6, + SDWA10 = 7, + GFX90A = 8, + GFX940 = 9, + GFX11 = 10, +}; +} + namespace SIInstrFlags { // This needs to be kept in sync with the field bits in InstSI. enum : uint64_t { diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -8240,23 +8240,7 @@ return {ImmField, RemainderOffset}; } -// This must be kept in sync with the SIEncodingFamily class in SIInstrInfo.td -// and the columns of the getMCOpcodeGen table. -enum SIEncodingFamily { - SI = 0, - VI = 1, - SDWA = 2, - SDWA9 = 3, - GFX80 = 4, - GFX9 = 5, - GFX10 = 6, - SDWA10 = 7, - GFX90A = 8, - GFX940 = 9, - GFX11 = 10, -}; - -static SIEncodingFamily subtargetEncodingFamily(const GCNSubtarget &ST) { +static unsigned subtargetEncodingFamily(const GCNSubtarget &ST) { switch (ST.getGeneration()) { default: break; @@ -8295,7 +8279,7 @@ } int SIInstrInfo::pseudoToMCOpcode(int Opcode) const { - SIEncodingFamily Gen = subtargetEncodingFamily(ST); + unsigned Gen = subtargetEncodingFamily(ST); if ((get(Opcode).TSFlags & SIInstrFlags::renamedInGFX9) != 0 && ST.getGeneration() == AMDGPUSubtarget::GFX9)