diff options
author | Jay Foad <jay.foad@amd.com> | 2023-06-30 08:14:40 +0100 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2023-07-12 14:29:26 +0100 |
commit | 58d1eaa3b6ce4f7285c51f83faff7a3ac374c746 (patch) | |
tree | a17d38c2068d69b7a99fd6cdf8af94eb75816e30 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | fb9a74122ef7730ae9839c63c4b7e9a78549d8e6 (diff) | |
download | llvm-58d1eaa3b6ce4f7285c51f83faff7a3ac374c746.zip llvm-58d1eaa3b6ce4f7285c51f83faff7a3ac374c746.tar.gz llvm-58d1eaa3b6ce4f7285c51f83faff7a3ac374c746.tar.bz2 |
[CodeGen] Store SP adjustment in MachineBasicBlock. NFCI.
Record the SP adjustment on entry to each basic block. This is almost
always zero except on targets like ARM which can split a basic block in
the middle of a call sequence.
This simplifies PEI::replaceFrameIndices which previously had to visit
basic blocks in a specific order and had special handling for
unreachable blocks. More importantly it paves the way for an equally
simple implementation of a backwards version of replaceFrameIndices,
which is required to fully convert PrologEpilogInserter to backwards
register scavenging, which is preferred because it does not rely on
accurate kill flags.
Differential Revision: https://reviews.llvm.org/D154281
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 23154449..0ccca7e 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -570,6 +570,11 @@ void MachineBasicBlock::printName(raw_ostream &os, unsigned printNameFlags, os << "bb_id " << *getBBID(); hasAttributes = true; } + if (SPAdjustment != 0) { + os << (hasAttributes ? ", " : " ("); + os << "sp-adjustment " << SPAdjustment; + hasAttributes = true; + } } if (hasAttributes) |