Skip to content

Commit 47a9cd0

Browse files
committed
[AMDGPU] Remove constexpr from getNumUserSGPRForField/getMaxNumPreloadedSGPRs to appease older gcc builds
Older versions of gcc wouldn't accept the constexpr getNumUserSGPRForField (introduced in D159439 / 343be51) as it couldn't treat the llvm_unreachable call as constexpr
1 parent 98a845c commit 47a9cd0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ unsigned GCNSubtarget::getMaxNumSGPRs(const MachineFunction &MF) const {
771771
getReservedNumSGPRs(MF));
772772
}
773773

774-
static constexpr unsigned getMaxNumPreloadedSGPRs() {
774+
static unsigned getMaxNumPreloadedSGPRs() {
775775
using USI = GCNUserSGPRUsageInfo;
776776
// Max number of user SGPRs
777777
const unsigned MaxUserSGPRs =

llvm/lib/Target/AMDGPU/GCNSubtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ class GCNUserSGPRUsageInfo {
14091409
};
14101410

14111411
// Returns the size in number of SGPRs for preload user SGPR field.
1412-
static constexpr unsigned getNumUserSGPRForField(UserSGPRID ID) {
1412+
static unsigned getNumUserSGPRForField(UserSGPRID ID) {
14131413
switch (ID) {
14141414
case ImplicitBufferPtrID:
14151415
return 2;

0 commit comments

Comments
 (0)