[llvm] [PGO] Add llvm.loop.estimated_trip_count metadata (PR #152775)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 19 04:02:05 PDT 2025
nikic wrote:
> With or without this PR, `{get,set}LoopEstimatedTripCount` operate on the branch weights of a loop's only latch (and they reject loops with more latches). My expectation is that merely moving the estimated trip count to loop metadata on that latch for each of the same loops should not worsen the above issue.
To be clear, the concern is not about loops with multiple latches, but two loops sharing one latch. You can have an inner loop latch that exits into an outer loop and is the latch of the outer loop. IIRC that's possible even in loop simplify form.
https://github.com/llvm/llvm-project/pull/152775
More information about the llvm-commits
mailing list