[PATCH] D120993: [PassManager] Add pretty stack entries before P->run() call.

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 15:17:12 PST 2022


dexonsmith added a comment.

In D120993#3372697 <https://reviews.llvm.org/D120993#3372697>, @fhahn wrote:

> In D120993#3370296 <https://reviews.llvm.org/D120993#3370296>, @aeubanks wrote:
>
>> In D120993#3370129 <https://reviews.llvm.org/D120993#3370129>, @fhahn wrote:
>>
>>> In D120993#3370083 <https://reviews.llvm.org/D120993#3370083>, @nikic wrote:
>>>
>>>> FYI it looks like this isn't as free as I would have expected: http://llvm-compile-time-tracker.com/compare.php?from=338dfcd60f843082bb589b287d890dbd9394eb82&to=128745cc2681c284bc6d0150a319673a6d6e8424&stat=instructions
>>>
>>> Yeah that's not great. I'll revert it in a bit and check if there's anything in particular that's very expensive.
>>
>> If I had to guess, it might be eagerly retrieving loop names or cgscc names since they can be pretty big if the scc contains a lot of functions or if the loop has a lot of blocks
>> we could start without the cgscc name and using the function name for loop passes
>
> I tried splitting off the loop & CGSCC handling into separate classes that only take pointers to Loop/ SCC. The compile-time impact is better, but still noticeable (worst config: +0.17% on ReleastThinLTO - https://llvm-compile-time-tracker.com/compare.php?from=af98b0af6705df3859ee3c98525b57025d40d9e8&to=bc328a534f528fbf8d7a37eaf08e70bd78b75896&stat=instructions)

A few ideas that might be worth considering (if they help), if you can't get it as cheap as it should be:

1. Add a `-cc1` option to clang for whether to add pretty stack tracing; turn it on by default, but have the driver pass `-skip-pretty-stack-traces-in-passes=true` to turn it off in release builds (checking `NDEBUG`, like `-discard-value-names=true` or whatever it is).
2. Land it but only handle the passes where the granularity is coarse enough that it's "cheap" (e.g., maybe just module/cgscc/function passes?).
3. Both: check for everything by default, but have the driver pass a `-cc1` option that turns off the expensive ones.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120993



More information about the llvm-commits mailing list