[PATCH] D136484: [CodeGen] Improve large stack frame diagnostic

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 13:27:19 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:305
+    float VarPct = 1 - SpillPct;
+    float UnsafePct = UnsafeStackSize / (float)StackSize;
+    auto VariableSize = StackSize - SpillSize;
----------------
nickdesaulniers wrote:
> Sink computing this into the condition below that is it's only consumer?
Note: we should not emit messages to `dbg()` in non-assertion builds.
This was fixed by 945f6e65be0d20b3446e7c1537c64151de618af4


================
Comment at: llvm/test/CodeGen/ARM/warn-stack.ll:27
+; CHECK: warning: stack frame size ([[STCK:[0-9]+]]) exceeds limit (80) in function 'warn_safestack'
+; CHECK: {{[0-9]+}}/[[STCK]] ({{.*}}%) spills, {{[0-9]+}}/[[STCK]] ({{.*}}%) variables, {{[0-9]+}}/[[STCK]] ({{.*}}%) unsafe stack
+define i32 @warn_safestack() nounwind ssp safestack "warn-stack-size"="80" {
----------------
We should not test dbgs messages. This was fixed by b97527f14459ef89bc94d652fcf94ba91b61b34c.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136484



More information about the llvm-commits mailing list