[llvm] [X86][APX] Implement push+push2+push pre-alignment strategy for PP2 (PR #205031)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 21 21:26:15 PDT 2026
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 origin/main HEAD --extensions cpp -- llvm/lib/Target/X86/X86FrameLowering.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</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 b703fc24b..798d9768c 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -395,11 +395,10 @@ MachineInstrBuilder X86FrameLowering::BuildStackAdjustment(
} else {
bool IsSub = Offset < 0;
uint64_t AbsOffset = IsSub ? -Offset : Offset;
- const unsigned Opc =
- IsSub ? (UseNF ? (unsigned)X86::SUB64ri32_NF
- : getSUBriOpcode(Uses64BitFramePtr))
- : (UseNF ? (unsigned)X86::ADD64ri32_NF
- : getADDriOpcode(Uses64BitFramePtr));
+ const unsigned Opc = IsSub ? (UseNF ? (unsigned)X86::SUB64ri32_NF
+ : getSUBriOpcode(Uses64BitFramePtr))
+ : (UseNF ? (unsigned)X86::ADD64ri32_NF
+ : getADDriOpcode(Uses64BitFramePtr));
MI = BuildMI(MBB, MBBI, DL, TII.get(Opc), StackPtr)
.addReg(StackPtr)
.addImm(AbsOffset);
@@ -2787,9 +2786,8 @@ void X86FrameLowering::emitEpilogue(MachineFunction &MF,
PI->getOperand(0).getReg() == StackPtr &&
(Opc == X86::ADD64ri32 || Opc == X86::ADD64ri32_NF ||
Opc == X86::ADD32ri || Opc == X86::LEA64r)) {
- int64_t SPAdj = Opc == X86::LEA64r
- ? PI->getOperand(4).getImm()
- : PI->getOperand(2).getImm();
+ int64_t SPAdj = Opc == X86::LEA64r ? PI->getOperand(4).getImm()
+ : PI->getOperand(2).getImm();
Offset += SPAdj;
BuildCFI(MBB, MBBI, DL,
MCCFIInstruction::cfiDefCfaOffset(nullptr, -Offset),
``````````
</details>
https://github.com/llvm/llvm-project/pull/205031
More information about the llvm-commits
mailing list