[llvm] [X86][CodeGen] Teach frame lowering to spill/reload registers w/ PUSHP/POPP, PUSH2[P]/POP2[P] (PR #73292)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 23:36:34 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 579e721ce91bd47a7e519a85f99498eb45d3d693 afa62a19251431df961e38eafa9df2f73f29b54b -- llvm/lib/Target/X86/X86FrameLowering.cpp llvm/lib/Target/X86/X86MachineFunctionInfo.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 14208f8513..babb1f68d3 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -1855,7 +1855,8 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
       // Mark callee-saved push instruction.
       // Define the current CFA rule to use the provided offset.
       assert(StackSize);
-      // Compared to push, push2 introduces more stack offset (one more register).
+      // Compared to push, push2 introduces more stack offset (one more
+      // register).
       if (LastCSPush->getOpcode() == X86::PUSH2 ||
           LastCSPush->getOpcode() == X86::PUSH2P)
         StackOffset += stackGrowth;
@@ -2495,7 +2496,8 @@ void X86FrameLowering::emitEpilogue(MachineFunction &MF,
       if (Opc == X86::POP32r || Opc == X86::POP64r || Opc == X86::POPP64r ||
           Opc == X86::POP2 || Opc == X86::POP2P) {
         Offset += SlotSize;
-        // Compared to pop, pop2 introduces more stack offset (one more register).
+        // Compared to pop, pop2 introduces more stack offset (one more
+        // register).
         if (Opc == X86::POP2 || Opc == X86::POP2P)
           Offset += SlotSize;
         BuildCFI(MBB, MBBI, DL,
diff --git a/llvm/lib/Target/X86/X86MachineFunctionInfo.h b/llvm/lib/Target/X86/X86MachineFunctionInfo.h
index 5fcb691b09..f6e853270e 100644
--- a/llvm/lib/Target/X86/X86MachineFunctionInfo.h
+++ b/llvm/lib/Target/X86/X86MachineFunctionInfo.h
@@ -172,7 +172,9 @@ public:
   const DenseMap<int, unsigned>& getWinEHXMMSlotInfo() const {
     return WinEHXMMSlotInfo; }
 
-  unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize + 8 * padForPush2Pop2(); }
+  unsigned getCalleeSavedFrameSize() const {
+    return CalleeSavedFrameSize + 8 * padForPush2Pop2();
+  }
   void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
 
   unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }

``````````

</details>


https://github.com/llvm/llvm-project/pull/73292


More information about the llvm-commits mailing list