Skip to content

Commit 9669aba

Browse files
authored
[Thumb1] LivePhysRegs to LiveRegUnits (#84474)
This removes the r7 exception because otherwise, LiveRegUnits will try to use that register.
1 parent f92fa7e commit 9669aba

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

llvm/lib/Target/ARM/Thumb1FrameLowering.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,11 @@ bool Thumb1FrameLowering::needPopSpecialFixUp(const MachineFunction &MF) const {
612612

613613
static void findTemporariesForLR(const BitVector &GPRsNoLRSP,
614614
const BitVector &PopFriendly,
615-
const LivePhysRegs &UsedRegs, unsigned &PopReg,
615+
const LiveRegUnits &UsedRegs, unsigned &PopReg,
616616
unsigned &TmpReg, MachineRegisterInfo &MRI) {
617617
PopReg = TmpReg = 0;
618618
for (auto Reg : GPRsNoLRSP.set_bits()) {
619-
if (UsedRegs.available(MRI, Reg)) {
619+
if (UsedRegs.available(Reg)) {
620620
// Remember the first pop-friendly register and exit.
621621
if (PopFriendly.test(Reg)) {
622622
PopReg = Reg;
@@ -684,7 +684,7 @@ bool Thumb1FrameLowering::emitPopSpecialFixUp(MachineBasicBlock &MBB,
684684
// Look for a temporary register to use.
685685
// First, compute the liveness information.
686686
const TargetRegisterInfo &TRI = *STI.getRegisterInfo();
687-
LivePhysRegs UsedRegs(TRI);
687+
LiveRegUnits UsedRegs(TRI);
688688
UsedRegs.addLiveOuts(MBB);
689689
// The semantic of pristines changed recently and now,
690690
// the callee-saved registers that are touched in the function
@@ -710,11 +710,6 @@ bool Thumb1FrameLowering::emitPopSpecialFixUp(MachineBasicBlock &MBB,
710710
unsigned TemporaryReg = 0;
711711
BitVector PopFriendly =
712712
TRI.getAllocatableSet(MF, TRI.getRegClass(ARM::tGPRRegClassID));
713-
// R7 may be used as a frame pointer, hence marked as not generally
714-
// allocatable, however there's no reason to not use it as a temporary for
715-
// restoring LR.
716-
if (STI.getFramePointerReg() == ARM::R7)
717-
PopFriendly.set(ARM::R7);
718713

719714
assert(PopFriendly.any() && "No allocatable pop-friendly register?!");
720715
// Rebuild the GPRs from the high registers because they are removed

0 commit comments

Comments
 (0)