<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp, branch users/nico/python-2</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>Revert "[llvm][NFC] Use `llvm::sort()`" (#140668)</title>
<updated>2025-05-20T03:27:03+00:00</updated>
<author>
<name>Iris Shi</name>
<email>0.0@owo.li</email>
</author>
<published>2025-05-20T03:27:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bdf03fcff3a6bce810ccb4b007f542de09aef42d'/>
<id>bdf03fcff3a6bce810ccb4b007f542de09aef42d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][NFC] Use `llvm::sort()` (#140335)</title>
<updated>2025-05-17T06:49:46+00:00</updated>
<author>
<name>Iris Shi</name>
<email>0.0@owo.li</email>
</author>
<published>2025-05-17T06:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=061a7699f343ed2a8782b48dc585f1ab7cc6727e'/>
<id>061a7699f343ed2a8782b48dc585f1ab7cc6727e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLGO] Properly Handle Counting Evictions of Candidates</title>
<updated>2025-03-05T07:19:50+00:00</updated>
<author>
<name>Aiden Grossman</name>
<email>aidengrossman@google.com</email>
</author>
<published>2025-03-05T07:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f1dbc45210cec766bed7dd320ed9420484ac3ec6'/>
<id>f1dbc45210cec766bed7dd320ed9420484ac3ec6</id>
<content type='text'>
This patch makes it so that onEviction actually gets called when the
model ends up selecting the candidate to evict. Where we were handling
this previously ended up being dead code as we would return earlier with
MCRegister::NoRegister.

Fixes #129841.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes it so that onEviction actually gets called when the
model ends up selecting the candidate to evict. Where we were handling
this previously ended up being dead code as we would return earlier with
MCRegister::NoRegister.

Fixes #129841.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][NewPM] Port RegAllocPriorityAdvisor analysis to NPM (#118462)</title>
<updated>2025-02-20T04:05:49+00:00</updated>
<author>
<name>Akshat Oke</name>
<email>Akshat.Oke@amd.com</email>
</author>
<published>2025-02-20T04:05:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=557628dbe6a935b1ad5e1bcfd51ac3a65e35d874'/>
<id>557628dbe6a935b1ad5e1bcfd51ac3a65e35d874</id>
<content type='text'>
Similar to #117309.

The advisor and logger are accessed through the provider, which is
served by the new PM. Legacy PM forwards calls to the provider.
New PM is a machine function analysis that lazily initializes the
provider.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to #117309.

The advisor and logger are accessed through the provider, which is
served by the new PM. Legacy PM forwards calls to the provider.
New PM is a machine function analysis that lazily initializes the
provider.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][NewPM] Port RegAllocEvictionAdvisor analysis to NPM (#117309)</title>
<updated>2025-02-18T11:55:06+00:00</updated>
<author>
<name>Akshat Oke</name>
<email>Akshat.Oke@amd.com</email>
</author>
<published>2025-02-18T11:55:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=519b53e65ef6ad5385d80d0726e48bbc3b08992f'/>
<id>519b53e65ef6ad5385d80d0726e48bbc3b08992f</id>
<content type='text'>
Legacy pass used to provide the advisor, so this extracts that logic
into a provider class used by both analysis passes.

All three (Default, Release, Development) legacy passes
`*AdvisorAnalysis` are basically renamed to `*AdvisorProvider`, so the
actual legacy wrapper passes are `*AdvisorAnalysisLegacy`.

There is only one NPM analysis `RegAllocEvictionAnalysis` that switches
between the three providers in the `::run` method, to be cached by the
NPM.

Also adds `RequireAnalysis&lt;RegAllocEvictionAnalysis&gt;` to the optimized
target reg alloc codegen builder.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Legacy pass used to provide the advisor, so this extracts that logic
into a provider class used by both analysis passes.

All three (Default, Release, Development) legacy passes
`*AdvisorAnalysis` are basically renamed to `*AdvisorProvider`, so the
actual legacy wrapper passes are `*AdvisorAnalysisLegacy`.

There is only one NPM analysis `RegAllocEvictionAnalysis` that switches
between the three providers in the `::run` method, to be cached by the
NPM.

Also adds `RequireAnalysis&lt;RegAllocEvictionAnalysis&gt;` to the optimized
target reg alloc codegen builder.</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[MLGO] Count LR Evictions Rather than Relying on Cascade (#124440)"</title>
<updated>2025-01-28T07:09:25+00:00</updated>
<author>
<name>Aiden Grossman</name>
<email>aidengrossman@google.com</email>
</author>
<published>2025-01-28T06:49:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=00f692b94f9aa08ede4aaba6f2aafe17857599c4'/>
<id>00f692b94f9aa08ede4aaba6f2aafe17857599c4</id>
<content type='text'>
This reverts commit aa65f93b71dee8cacb22be1957673c8be6a3ec24.

This relands commit 8cc83b66e20e72cdb3bb5fbd549c941797b0e0c9.

It looks like this was a transitive include issue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit aa65f93b71dee8cacb22be1957673c8be6a3ec24.

This relands commit 8cc83b66e20e72cdb3bb5fbd549c941797b0e0c9.

It looks like this was a transitive include issue.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[MLGO] Count LR Evictions Rather than Relying on Cascade (#124440)"</title>
<updated>2025-01-28T00:22:25+00:00</updated>
<author>
<name>Aiden Grossman</name>
<email>aidengrossman@google.com</email>
</author>
<published>2025-01-28T00:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aa65f93b71dee8cacb22be1957673c8be6a3ec24'/>
<id>aa65f93b71dee8cacb22be1957673c8be6a3ec24</id>
<content type='text'>
This reverts commit 8cc83b66e20e72cdb3bb5fbd549c941797b0e0c9.

This was causing builbot failures.
https://lab.llvm.org/buildbot/#/builders/90/builds/4198
https://lab.llvm.org/buildbot/#/builders/110/builds/3616
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 8cc83b66e20e72cdb3bb5fbd549c941797b0e0c9.

This was causing builbot failures.
https://lab.llvm.org/buildbot/#/builders/90/builds/4198
https://lab.llvm.org/buildbot/#/builders/110/builds/3616
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLGO] Count LR Evictions Rather than Relying on Cascade (#124440)</title>
<updated>2025-01-27T23:23:37+00:00</updated>
<author>
<name>Aiden Grossman</name>
<email>aidengrossman@google.com</email>
</author>
<published>2025-01-27T23:23:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8cc83b66e20e72cdb3bb5fbd549c941797b0e0c9'/>
<id>8cc83b66e20e72cdb3bb5fbd549c941797b0e0c9</id>
<content type='text'>
This patch adjusts the mlregalloc-max-cascade flag (renaming it to
mlregalloc-max-eviction-count) to actually count evictions rather than
just looking at the cascade number. The cascade number is not very
representative of how many times a LR has been evicted, which can lead
to some problems in certain cases, where we might end up with many
eviction problems where we have now masked off all the interferences and
are forced to evict the candidate.

This is probably what I should've done in the first place. No test case
as this only shows up in quite large functions post ThinLTO and it would
be hard to construct something that would serve as a nice regression
test without being super brittle. I've tested this on the pathological
cases that we have come across so far and it works.

Fixes #122829</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adjusts the mlregalloc-max-cascade flag (renaming it to
mlregalloc-max-eviction-count) to actually count evictions rather than
just looking at the cascade number. The cascade number is not very
representative of how many times a LR has been evicted, which can lead
to some problems in certain cases, where we might end up with many
eviction problems where we have now masked off all the interferences and
are forced to evict the candidate.

This is probably what I should've done in the first place. No test case
as this only shows up in quite large functions post ThinLTO and it would
be hard to construct something that would serve as a nice regression
test without being super brittle. I've tested this on the pathological
cases that we have come across so far and it works.

Fixes #122829</pre>
</div>
</content>
</entry>
<entry>
<title>[MLGO] Do not include urgent LRs in max cascade calculation (#120052)</title>
<updated>2024-12-16T15:14:34+00:00</updated>
<author>
<name>Aiden Grossman</name>
<email>aidengrossman@google.com</email>
</author>
<published>2024-12-16T15:14:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=76f258920d3baf32be297f60bee5b8520f195c25'/>
<id>76f258920d3baf32be297f60bee5b8520f195c25</id>
<content type='text'>
A previous PR introduced a threshold where we would mask out a LR that
had been evicted a certain number of times to combat pathological
compile time cases with a somewhat adversarial model. However, this
patch did not take into account urgent LRs which led to compilation
failures when greedy would expect us to provide an eviction and we could
not due to the newly introduced logic.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A previous PR introduced a threshold where we would mask out a LR that
had been evicted a certain number of times to combat pathological
compile time cases with a somewhat adversarial model. However, this
patch did not take into account urgent LRs which led to compilation
failures when greedy would expect us to provide an eviction and we could
not due to the newly introduced logic.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLGO] Add Threshold to Prevent Pathological Compile Time Cases (#119807)</title>
<updated>2024-12-13T04:46:45+00:00</updated>
<author>
<name>Aiden Grossman</name>
<email>aidengrossman@google.com</email>
</author>
<published>2024-12-13T04:46:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=60325abeb3226b17c28429dfa6e175f25c171ec0'/>
<id>60325abeb3226b17c28429dfa6e175f25c171ec0</id>
<content type='text'>
This patch adds a threshold flag, -mlregalloc-max-cascade, to prevent
live ranges from being evicted more than is necessary.

After deploying a new regalloc model, we ran into some pathological
cases where the model decided it wanted to ping-pong evictions, taking
up a large amount of compile time. This threshold is mostly a stop gap
while we continue to investigate other solutions and work on
minimizing/constructing test cases.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a threshold flag, -mlregalloc-max-cascade, to prevent
live ranges from being evicted more than is necessary.

After deploying a new regalloc model, we ran into some pathological
cases where the model decided it wanted to ping-pong evictions, taking
up a large amount of compile time. This threshold is mostly a stop gap
while we continue to investigate other solutions and work on
minimizing/constructing test cases.</pre>
</div>
</content>
</entry>
</feed>
