[llvm] [CodeGen] Distinguish zero-sized call frames from no call frame in MachineBB (PR #106964)
Fabian Ritter via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 03:49:33 PDT 2024
================
@@ -3837,11 +3837,11 @@ void MachineVerifier::verifyStackFrame() {
BBState.ExitIsSetup = BBState.EntryIsSetup;
}
- if ((int)MBB->getCallFrameSize() != -BBState.EntryValue) {
+ if ((int)MBB->getCallFrameSizeOrZero() != -BBState.EntryValue) {
----------------
ritter-x2a wrote:
I've updated the PR to a version with the adjusted MachineVerifier and fixes for the lit tests that failed with it. However, it's difficult to say whether this captures all cases where a CALLSEQ might be split across MachineBBs. For instance, I found 126 references (in 62 files) to MachineBasicBlock::splice; I think we'd have to handle them (and other cases, e.g., where new MachineBBs are created) or check that they can't affect CALLSEQs to be really sure we caught everything.
An alternative would be to drop the stored call frame size from the MachineBBs and compute up-to-date call frame sizes only when they are needed, i.e., in the PrologueEpilogueInserter and where I use it in #106965.
What's your opinion on that?
https://github.com/llvm/llvm-project/pull/106964
More information about the llvm-commits
mailing list