[llvm] baa1fc9 - [ARM] Remove always-true checks from Thumb1 frame lowering (NFC) (#110283)

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 01:29:44 PDT 2024


Author: Oliver Stannard
Date: 2024-10-09T09:29:28+01:00
New Revision: baa1fc9825ca29a81f98146da6036e3415182f16

URL: https://github.com/llvm/llvm-project/commit/baa1fc9825ca29a81f98146da6036e3415182f16
DIFF: https://github.com/llvm/llvm-project/commit/baa1fc9825ca29a81f98146da6036e3415182f16.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/Thumb1FrameLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
index 4fbf378417bca6..e7d0a14da6dc9d 100644
--- a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
+++ b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
@@ -160,8 +160,8 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
   assert(NumBytes >= ArgRegsSaveSize &&
          "ArgRegsSaveSize is included in NumBytes");
   const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo();
-  ARMSubtarget::PushPopSplitVariation PushPopSplit =
-      STI.getPushPopSplitVariation(MF);
+  assert(STI.getPushPopSplitVariation(MF) == ARMSubtarget::SplitR7 &&
+         "Must use R7 spilt for Thumb1");
 
   // Debug location must be unknown since the first debug location is used
   // to determine the end of the prologue.
@@ -223,11 +223,8 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
     case ARM::R8:
     case ARM::R9:
     case ARM::R10:
-      if (PushPopSplit == ARMSubtarget::SplitR7) {
-        GPRCS2Size += 4;
-        break;
-      }
-      [[fallthrough]];
+      GPRCS2Size += 4;
+      break;
     case ARM::LR:
       if (HasFrameRecordArea) {
         FRSize += 4;
@@ -367,9 +364,7 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
       case ARM::R10:
       case ARM::R11:
       case ARM::R12:
-        if (PushPopSplit == ARMSubtarget::SplitR7)
-          break;
-        [[fallthrough]];
+        break;
       case ARM::R0:
       case ARM::R1:
       case ARM::R2:


        


More information about the llvm-commits mailing list