[PATCH] D123932: MachineModuleInfo: Move HasSplitStack handling to AsmPrinter

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 12:42:20 PDT 2022


rnk added a comment.

I read through the situation described in PR37807 <https://github.com/llvm/llvm-project/issues/37155> the two relevant commits (rG9cc1ffadc5ad06ab846a7da95a1afb874b9f3d98 <https://reviews.llvm.org/rG9cc1ffadc5ad06ab846a7da95a1afb874b9f3d98> and D48444 <https://reviews.llvm.org/D48444>), and I think I understand the two issues.

I think it would be simpler if we tracked a boolean (`HasSplitStackPrologue`) on each MachineFrameInfo object indicating whether a split stack prologue was emitted or not for some particular function. This avoids the need to duplicate this stack size and tail call checking logic in the AsmPrinter.

The root of the issue here is that we are checking IR attributes in `MF.shouldSplitStack()`, but we allow ourselves to revise that decision during prologue emission if we have a leaf function that doesn't use any stack. The AsmPrinter should look at the MIR, not the IR, and that will simplify things.



================
Comment at: llvm/lib/Target/ARM/ARMAsmPrinter.cpp:27
 #include "llvm/BinaryFormat/COFF.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
----------------
Seems unnecessary?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123932/new/

https://reviews.llvm.org/D123932



More information about the llvm-commits mailing list