Skip to content

Commit 6b0461f

Browse files
committed
Revert "Test commit: add a parameter to keep reserved"
This reverts commit e96f7f7.
1 parent e96f7f7 commit 6b0461f

File tree

14 files changed

+3606
-3815
lines changed

14 files changed

+3606
-3815
lines changed

llvm/include/llvm/CodeGen/TargetRegisterInfo.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,8 @@ class TargetRegisterInfo : public MCRegisterInfo {
914914

915915
/// Get the register unit pressure limit for this dimension.
916916
/// This limit must be adjusted dynamically for reserved registers.
917-
/// If RemoveReserved is true, the target should remove reserved registers.
918917
virtual unsigned getRegPressureSetLimit(const MachineFunction &MF,
919-
unsigned Idx,
920-
bool RemoveReserved = true) const = 0;
918+
unsigned Idx) const = 0;
921919

922920
/// Get the dimensions of register pressure impacted by this register class.
923921
/// Returns a -1 terminated array of pressure set IDs.

llvm/lib/CodeGen/RegisterClassInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ unsigned RegisterClassInfo::computePSetLimit(unsigned Idx) const {
222222
assert(RC && "Failed to find register class");
223223
compute(RC);
224224
unsigned NAllocatableRegs = getNumAllocatableRegs(RC);
225-
unsigned RegPressureSetLimit =
226-
TRI->getRegPressureSetLimit(*MF, Idx, /*RemoveReserved=*/false);
225+
unsigned RegPressureSetLimit = TRI->getRegPressureSetLimit(*MF, Idx);
227226
// If all the regs are reserved, return raw RegPressureSetLimit.
228227
// One example is VRSAVERC in PowerPC.
229228
// Avoid returning zero, getRegPressureSetLimit(Idx) assumes computePSetLimit

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,8 +3640,7 @@ unsigned SIRegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC,
36403640
}
36413641

36423642
unsigned SIRegisterInfo::getRegPressureSetLimit(const MachineFunction &MF,
3643-
unsigned Idx,
3644-
bool RemoveReserved) const {
3643+
unsigned Idx) const {
36453644
if (Idx == AMDGPU::RegisterPressureSets::VGPR_32 ||
36463645
Idx == AMDGPU::RegisterPressureSets::AGPR_32)
36473646
return getRegPressureLimit(&AMDGPU::VGPR_32RegClass,

llvm/lib/Target/AMDGPU/SIRegisterInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ class SIRegisterInfo final : public AMDGPUGenRegisterInfo {
331331
unsigned getRegPressureLimit(const TargetRegisterClass *RC,
332332
MachineFunction &MF) const override;
333333

334-
unsigned getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx,
335-
bool RemoveReserved = true) const override;
334+
unsigned getRegPressureSetLimit(const MachineFunction &MF,
335+
unsigned Idx) const override;
336336

337337
const int *getRegUnitPressureSets(unsigned RegUnit) const override;
338338

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -936,12 +936,8 @@ bool RISCVRegisterInfo::getRegAllocationHints(
936936
}
937937

938938
unsigned RISCVRegisterInfo::getRegPressureSetLimit(const MachineFunction &MF,
939-
unsigned Idx,
940-
bool RemoveReserved) const {
939+
unsigned Idx) const {
941940
if (Idx == RISCV::RegisterPressureSets::GPRAll) {
942-
if (!RemoveReserved)
943-
return 32;
944-
945941
unsigned Reserved = 0;
946942
BitVector ReservedRegs = getReservedRegs(MF);
947943
for (MCPhysReg Reg = RISCV::X0_H; Reg <= RISCV::X31_H; Reg++)
@@ -950,5 +946,5 @@ unsigned RISCVRegisterInfo::getRegPressureSetLimit(const MachineFunction &MF,
950946

951947
return 32 - Reserved;
952948
}
953-
return RISCVGenRegisterInfo::getRegPressureSetLimit(MF, Idx, RemoveReserved);
949+
return RISCVGenRegisterInfo::getRegPressureSetLimit(MF, Idx);
954950
}

llvm/lib/Target/RISCV/RISCVRegisterInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ struct RISCVRegisterInfo : public RISCVGenRegisterInfo {
144144
static bool isRVVRegClass(const TargetRegisterClass *RC) {
145145
return RISCVRI::isVRegClass(RC->TSFlags);
146146
}
147-
unsigned getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx,
148-
bool RemoveReserved = true) const override;
147+
unsigned getRegPressureSetLimit(const MachineFunction &MF,
148+
unsigned Idx) const override;
149149
};
150150
} // namespace llvm
151151

0 commit comments

Comments
 (0)