[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
Tue Sep 3 02:55:18 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:
When implementing this, I noticed cases where MachineBBs are inserted but their call frame size is not set, e.g., in [X86FrameLowering](https://github.com/llvm/llvm-project/blob/79c40aa7a7d05546410870ac49f5d81a11f0bff2/llvm/lib/Target/X86/X86FrameLowering.cpp#L933) and in [AMDGPURegisterBankInfo](https://github.com/llvm/llvm-project/blob/79c40aa7a7d05546410870ac49f5d81a11f0bff2/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp#L818).
The call frames in the tests that fail because of that with my adjusted MachineVerifier (one X86 and one AMDGPU) happen to be zero-sized, so the current implementation does not find an issue.
Do you recall if there was a reason why the call frame sizes for such MachineBBs introduced after ISel are not set in the [original patch](https://reviews.llvm.org/D156113) for storing the call frame size in MachineBasicBlock?
https://github.com/llvm/llvm-project/pull/106964
More information about the llvm-commits
mailing list