[llvm] [CodeGen] Distinguish zero-sized call frames from no call frame in MachineBB (PR #106964)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 04:00:57 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) {
----------------
jayfoad wrote:

> 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

The whole point of storing the frame size in `MachineBB` is so that `PEI` does not have to do a complete forward walk over the function to compute frame sizes, in addition to the backward walk that it does to eliminate frame indices. My assumption was that the forward walk would be expensive, but if you can do it without angering https://llvm-compile-time-tracker.com/ then go for it!

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


More information about the llvm-commits mailing list