<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/IR/ProfDataUtils.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[MergeICmp][profcheck] Propagate profile info (#167594)</title>
<updated>2025-11-14T17:29:41+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-11-14T17:29:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ac84a61937e629382cd916d0597922626b93888'/>
<id>9ac84a61937e629382cd916d0597922626b93888</id>
<content type='text'>
Propagate branch weights in `mergeComparisons`​ : the probability of reaching the common "exit" BB (`bb_phi`​ in the description in `processPhi`​)doesn't change, and is a disjunction over the probabilities of doing that from the blocks performing comparisons which are now being merged  
  
Issue #147390</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Propagate branch weights in `mergeComparisons`​ : the probability of reaching the common "exit" BB (`bb_phi`​ in the description in `processPhi`​)doesn't change, and is a disjunction over the probabilities of doing that from the blocks performing comparisons which are now being merged  
  
Issue #147390</pre>
</div>
</content>
</entry>
<entry>
<title>[ProfCheck][NFC] Make Function argument from branch weight setter optional (#166032)</title>
<updated>2025-11-05T15:40:37+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-11-05T15:40:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=52cb6e9d49f836b624bd0536734afd7aa4194ca0'/>
<id>52cb6e9d49f836b624bd0536734afd7aa4194ca0</id>
<content type='text'>
This picks up from #166028, making the `Function` argument optional:
most cases don't need to provide it, but in e.g. InstCombine's case,
where the instruction (select, branch) is not attached to a function
yet, the function needs to be passed explicitly.

Co-authored-by: Florian Hahn &lt;flo@fhahn.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This picks up from #166028, making the `Function` argument optional:
most cases don't need to provide it, but in e.g. InstCombine's case,
where the instruction (select, branch) is not attached to a function
yet, the function needs to be passed explicitly.

Co-authored-by: Florian Hahn &lt;flo@fhahn.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][LLVM][IR] Fix namespace usage in several files (#161756)</title>
<updated>2025-10-03T12:00:40+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2025-10-03T12:00:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d32ea87673adaa5252545ca82fa6cd58b134ff9'/>
<id>4d32ea87673adaa5252545ca82fa6cd58b134ff9</id>
<content type='text'>
- Move standalone functions/variables out of anonymous namespace and
make them static.
- Use `using namespace llvm` instead of wrapping all the code in a file
in `namespace llvm { }`.
- Restrict anonymous namespace to just class/struct/enum declarations.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Move standalone functions/variables out of anonymous namespace and
make them static.
- Use `using namespace llvm` instead of wrapping all the code in a file
in `namespace llvm { }`.
- Restrict anonymous namespace to just class/struct/enum declarations.</pre>
</div>
</content>
</entry>
<entry>
<title>[SimplifyCFG][PGO] Reuse existing `setBranchWeights` (#160629)</title>
<updated>2025-10-01T16:54:30+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-10-01T16:54:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=240b73e10f5c6549776cfd3847db2be14dc42776'/>
<id>240b73e10f5c6549776cfd3847db2be14dc42776</id>
<content type='text'>
The main difference between SimplifyCFG's `setBranchWeights`​ and the ProfDataUtils' is that the former doesn't propagate all-zero weights. That seems like a sensible thing to do, so updated the latter accordingly, and added a flag to control the behavior.

Also moved to ProfDataUtils the logic fitting 64-bit weights to 32-bit.

As side-effect, this fixes some profcheck failures.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The main difference between SimplifyCFG's `setBranchWeights`​ and the ProfDataUtils' is that the former doesn't propagate all-zero weights. That seems like a sensible thing to do, so updated the latter accordingly, and added a flag to control the behavior.

Also moved to ProfDataUtils the logic fitting 64-bit weights to 32-bit.

As side-effect, this fixes some profcheck failures.</pre>
</div>
</content>
</entry>
<entry>
<title>[InstCombine] Set !prof metadata on Selects identified by add.ll test (#158743)</title>
<updated>2025-09-29T20:37:06+00:00</updated>
<author>
<name>Alan Zhao</name>
<email>ayzhao@google.com</email>
</author>
<published>2025-09-29T20:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=045e09f22b6149bb8288e458a465f1b16cb88b77'/>
<id>045e09f22b6149bb8288e458a465f1b16cb88b77</id>
<content type='text'>
These select instructions are created from non-branching instructions,
so their branch weights are unknown.

Tracking issue: #147390</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These select instructions are created from non-branching instructions,
so their branch weights are unknown.

Tracking issue: #147390</pre>
</div>
</content>
</entry>
<entry>
<title>[PGO] Add llvm.loop.estimated_trip_count metadata (#152775)</title>
<updated>2025-09-11T19:55:18+00:00</updated>
<author>
<name>Joel E. Denny</name>
<email>jdenny.ornl@gmail.com</email>
</author>
<published>2025-09-11T19:55:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0e3c5566c0c62a56629a927d7de5e2594d2dbe7c'/>
<id>0e3c5566c0c62a56629a927d7de5e2594d2dbe7c</id>
<content type='text'>
This patch implements the `llvm.loop.estimated_trip_count` metadata
discussed in [[RFC] Fix Loop Transformations to Preserve Block
Frequencies](https://discourse.llvm.org/t/rfc-fix-loop-transformations-to-preserve-block-frequencies/85785).
As the RFC explains, that metadata enables future patches, such as PR
#128785, to fix block frequency issues without losing estimated trip
counts.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch implements the `llvm.loop.estimated_trip_count` metadata
discussed in [[RFC] Fix Loop Transformations to Preserve Block
Frequencies](https://discourse.llvm.org/t/rfc-fix-loop-transformations-to-preserve-block-frequencies/85785).
As the RFC explains, that metadata enables future patches, such as PR
#128785, to fix block frequency issues without losing estimated trip
counts.</pre>
</div>
</content>
</entry>
<entry>
<title>[profcheck] Require `unknown` metadata have an origin parameter (#157594)</title>
<updated>2025-09-10T22:34:35+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-09-10T22:34:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f2d827c444d07b722a94689b427d6ad2d1c6b1b7'/>
<id>f2d827c444d07b722a94689b427d6ad2d1c6b1b7</id>
<content type='text'>
Rather than passes using `!prof = !{!”unknown”}`​for cases where don’t have enough information to emit profile values, this patch captures the pass (or some other information) that can help diagnostics - i.e. `!{!”unknown”, !”some-pass-name”}`​.

For example, suppose we emitted a `select`​ with the unknown metadata, and, later, end up needing to lower that to a conditional branch. If we observe (via sample profiling, for example) that the branch is biased and would have benefitted from a valid profile, the extra information can help speed up debugging.

We can also (in a subsequent pass) generate optimization remarks about such lowered selects, with a similar aim - identify patterns lowering to `select`​ that may be worth some extra investment in extracting a more precise profile.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than passes using `!prof = !{!”unknown”}`​for cases where don’t have enough information to emit profile values, this patch captures the pass (or some other information) that can help diagnostics - i.e. `!{!”unknown”, !”some-pass-name”}`​.

For example, suppose we emitted a `select`​ with the unknown metadata, and, later, end up needing to lower that to a conditional branch. If we observe (via sample profiling, for example) that the branch is biased and would have benefitted from a valid profile, the extra information can help speed up debugging.

We can also (in a subsequent pass) generate optimization remarks about such lowered selects, with a similar aim - identify patterns lowering to `select`​ that may be worth some extra investment in extracting a more precise profile.</pre>
</div>
</content>
</entry>
<entry>
<title>[profcheck] Allow `unknown` function entry count (#155918)</title>
<updated>2025-09-04T20:15:23+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-09-04T20:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a99532b8913e4f4a7777d04d56ed0729d3838f9'/>
<id>2a99532b8913e4f4a7777d04d56ed0729d3838f9</id>
<content type='text'>
Some passes synthesize functions, e.g. WPD, so we may need to indicate “this synthesized function’s entry count cannot be estimated at compile time” - akin to `branch_weights`​.

Issue #147390</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some passes synthesize functions, e.g. WPD, so we may need to indicate “this synthesized function’s entry count cannot be estimated at compile time” - akin to `branch_weights`​.

Issue #147390</pre>
</div>
</content>
</entry>
<entry>
<title>Use `uint32_t` rather than `unsigned` in `downscaleWeights` (#153750)</title>
<updated>2025-08-15T06:22:45+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-08-15T06:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=45e6951ba7b305dbad218e88d64f27c1f2c4b7cf'/>
<id>45e6951ba7b305dbad218e88d64f27c1f2c4b7cf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix after #153735 (#153749)</title>
<updated>2025-08-15T06:14:53+00:00</updated>
<author>
<name>Mircea Trofin</name>
<email>mtrofin@google.com</email>
</author>
<published>2025-08-15T06:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8da1ce559e63a16ad05c22787d01112859cf4d89'/>
<id>8da1ce559e63a16ad05c22787d01112859cf4d89</id>
<content type='text'>
Example failure
&lt;https://lab.llvm.org/buildbot/#/builders/105/builds/11073&gt;

Seems compiler-dependent.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Example failure
&lt;https://lab.llvm.org/buildbot/#/builders/105/builds/11073&gt;

Seems compiler-dependent.</pre>
</div>
</content>
</entry>
</feed>
