diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-09-13 12:19:01 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-09-13 12:19:28 +0100 |
commit | 47a9cd03435342f179a0df9daa1b918d33b03354 (patch) | |
tree | 73ad1908b2ee54938cc19d1088b18b9602529740 | |
parent | 98a845c142160879ebfadcc192025c6be7e9083e (diff) | |
download | llvm-47a9cd03435342f179a0df9daa1b918d33b03354.zip llvm-47a9cd03435342f179a0df9daa1b918d33b03354.tar.gz llvm-47a9cd03435342f179a0df9daa1b918d33b03354.tar.bz2 |
[AMDGPU] Remove constexpr from getNumUserSGPRForField/getMaxNumPreloadedSGPRs to appease older gcc builds
Older versions of gcc wouldn't accept the constexpr getNumUserSGPRForField (introduced in D159439 / 343be5132e2831d85) as it couldn't treat the llvm_unreachable call as constexpr
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/GCNSubtarget.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index c62ee84..cc179c8 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -771,7 +771,7 @@ unsigned GCNSubtarget::getMaxNumSGPRs(const MachineFunction &MF) const { getReservedNumSGPRs(MF)); } -static constexpr unsigned getMaxNumPreloadedSGPRs() { +static unsigned getMaxNumPreloadedSGPRs() { using USI = GCNUserSGPRUsageInfo; // Max number of user SGPRs const unsigned MaxUserSGPRs = diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h index 0a4c4d6..b595682 100644 --- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h +++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h @@ -1409,7 +1409,7 @@ public: }; // Returns the size in number of SGPRs for preload user SGPR field. - static constexpr unsigned getNumUserSGPRForField(UserSGPRID ID) { + static unsigned getNumUserSGPRForField(UserSGPRID ID) { switch (ID) { case ImplicitBufferPtrID: return 2; |