[llvm] [NFC][Coverage] Do not use recursion for GCOV propagateCounts. (PR #68455)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 22:18:00 PDT 2023


https://github.com/MaskRay requested changes to this pull request.

Thanks for the change but please give me time to review and don't hurry on merging. 

> This causes stack overflows for some real-world kernel libraries.

Is there an internal bug I can take a look.

The maximum depth is bounded by the longest tree edge (Kirchhoff's circuit law optimization I added to llvm/clang gcov). If all tree edges are correctly computed, an overflowed stack (default 8MiB) suggests a really huge number of basic blocks in the function. Is it really the case? If not, we need deep analysis.

If iteration is really needed for propagateCounts, I'd prefer a style similar to `augmentOneCycle` (where I lowered the time complexity to O(E^2)).


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


More information about the llvm-commits mailing list