[llvm] [llvm][IR] Extend BranchWeightMetadata to track provenance of weights (PR #86609)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 13:00:56 PDT 2024


ilovepi wrote:

> This change causes compile-time regressions for stage2 builds only (https://llvm-compile-time-tracker.com/compare.php?from=3254f31a66263ea9647c9547f1531c3123444fcd&to=c5978f1eb5eeca8610b9dfce1fcbf1f473911cd8&stat=instructions:u). This indicates that it makes clang codegen worse in some way that affects clang itself.
> 
> I assume this was intended to be NFC in terms of generated code, so something is probably not handling the new format correctly?

Yes, this shouldn't introduce any difference in terms of generated code. There's a slight increase in cost for some metadata operations but they should be minimal, and only affect on handling for MD_prof metadata, but I'm surprised it's measurable. 

Off chance, do you know if the stage-2 build you're testing enables LTO? I'm wondering if some of the routines should be moved to the header, so they can be inlined. If LTO is enabled, then that won't help, since I'd imagine they've been inlined already.

I can try to benchmark w/ the test-suite later, but it will take me a bit to set that up and investigate. If you're concerned about the regression feel free to revert.

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


More information about the llvm-commits mailing list