[llvm] [LoopPeel] Fix branch weights' effect on block frequencies (PR #128785)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Thu May 1 10:36:59 PDT 2025


================
@@ -7866,6 +7866,17 @@ The attributes in this metadata is added to all followup loops of the
 loop distribution pass. See
 :ref:`Transformation Metadata <transformation-metadata>` for details.
 
+'``llvm.loop.estimated_trip_count``' Metadata
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
----------------
jdenny-ornl wrote:

> Should explain where it should be attached. What if it's not placed on an arbitrary terminator that isn't a loop backed?

The [`llvm.loop` metadata description](https://llvm.org/docs/LangRef.html#llvm-loop) explains placement generally for all `llvm.loop.*` metadata.  I've also added an example in the same manner as the docs I see for other `llvm.loop.*` metadata.

> Consequences for it being incorrect?

I've added a description of how it's consumed.

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


More information about the llvm-commits mailing list