[PATCH] D135488: [codegen] Add a remarks based Stack Layout Analysis pass

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 12 16:21:51 PST 2023


nickdesaulniers accepted this revision.
nickdesaulniers added a comment.

In D135488#4049035 <https://reviews.llvm.org/D135488#4049035>, @paulkirth wrote:

> Actually if we add
>
>   if (!isFunctionInPrintList(MF.getName()))
>        return false;
>
> we can filter by name

Does name mangling complicate that? Perhaps a C++ user would give an unmangled name, but MF would be looking at mangled names?

Anyways, it's not a pressing issue. I won't block this patch on that. I just redirect all the output to a file then scan that.

Same thing about adding passes to -O0. Someone might care about that, but I don't.

Nice work @paulkirth . I'm excited to use this to help us better understand and reduce our stack usage in the Linux kernel!



================
Comment at: llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll:43-46
+; HOTNESS:      Executing Pass 'Stack Frame Layout Analysis'
+; HOTNESS-NEXT: Freeing Pass 'Machine Optimization Remark Emitter'
+; HOTNESS-NEXT: Freeing Pass 'Lazy Machine Block Frequency Analysis'
+; HOTNESS-NEXT: Freeing Pass 'Stack Frame Layout Analysis'
----------------
paulkirth wrote:
> nickdesaulniers wrote:
> > what's going on in this test? Looks like the pass is being run twice or something?
> not sure I follow. The block here is executing the pass then freeing the pass. I tried to follow the pattern used around this, but we could change it to
> 
> ```
> HOTNESS:      Executing Pass 'Stack Frame Layout Analysis'
> HOTNESS:      Freeing Pass 'Stack Frame Layout Analysis'
> ```
> and skip the rest
Oops, I missed the first instance is `Executing` then the second is `Freeing`. NVM!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135488



More information about the cfe-commits mailing list