Skip to content

Commit baa1fc9

Browse files
committed
[ARM] Remove always-true checks from Thumb1 frame lowering (NFC) (#110283)
For Thumb1, we always split the callee-saved register pushes at R7, so we don't need to check for this.
1 parent 754c1f2 commit baa1fc9

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

llvm/lib/Target/ARM/Thumb1FrameLowering.cpp

+5-10
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
160160
assert(NumBytes >= ArgRegsSaveSize &&
161161
"ArgRegsSaveSize is included in NumBytes");
162162
const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo();
163-
ARMSubtarget::PushPopSplitVariation PushPopSplit =
164-
STI.getPushPopSplitVariation(MF);
163+
assert(STI.getPushPopSplitVariation(MF) == ARMSubtarget::SplitR7 &&
164+
"Must use R7 spilt for Thumb1");
165165

166166
// Debug location must be unknown since the first debug location is used
167167
// to determine the end of the prologue.
@@ -223,11 +223,8 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
223223
case ARM::R8:
224224
case ARM::R9:
225225
case ARM::R10:
226-
if (PushPopSplit == ARMSubtarget::SplitR7) {
227-
GPRCS2Size += 4;
228-
break;
229-
}
230-
[[fallthrough]];
226+
GPRCS2Size += 4;
227+
break;
231228
case ARM::LR:
232229
if (HasFrameRecordArea) {
233230
FRSize += 4;
@@ -367,9 +364,7 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
367364
case ARM::R10:
368365
case ARM::R11:
369366
case ARM::R12:
370-
if (PushPopSplit == ARMSubtarget::SplitR7)
371-
break;
372-
[[fallthrough]];
367+
break;
373368
case ARM::R0:
374369
case ARM::R1:
375370
case ARM::R2:

0 commit comments

Comments
 (0)