<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/MachineBlockPlacement.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>[CodeGen][CodeLayout] Fix segfault on access to deleted block in MBP. (#142357)</title>
<updated>2025-06-23T14:04:22+00:00</updated>
<author>
<name>Afanasyev Ivan</name>
<email>ivafanas@gmail.com</email>
</author>
<published>2025-06-23T14:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d0e5d6fd6180b0f294a00cf48996219df97c9e78'/>
<id>d0e5d6fd6180b0f294a00cf48996219df97c9e78</id>
<content type='text'>
Problem 1: There is a typo which reassigns `BlockWorkList` to
`EHPadWorkList` on attempt to remove `RemBB` from work lists.

Problem 2: `Chain-&gt;UnscheduledPredecessors == 0` is an incorrect way to
check whether `RemBB` is enqueued or not. The root cause is a postponed
deletion of `WorkList` from already scheduled blocks in
`selectBestCandidateBlock`. Bug happens in the following scenario:

* `FunctionChain` is being processed with non-zero
`UnscheduledPredecessors`
* Block `B'` is added to the `BlockWorkList`
* Block `B'` is chosen as the best successor (`selectBestSuccessor`) for
some another block and added into `Chain`
* Block `B'` is removed by tail duplicator.

`RemovalCallback` erroneously won't erase `B'` from `BlockWorkList`,
because `UnscheduledPredecessors` value of `FunctionChain` is not zero
(and it is allowed to be non-zero).

Proposed solution is to always cleanup worklists on block deletion by
tail duplicator.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem 1: There is a typo which reassigns `BlockWorkList` to
`EHPadWorkList` on attempt to remove `RemBB` from work lists.

Problem 2: `Chain-&gt;UnscheduledPredecessors == 0` is an incorrect way to
check whether `RemBB` is enqueued or not. The root cause is a postponed
deletion of `WorkList` from already scheduled blocks in
`selectBestCandidateBlock`. Bug happens in the following scenario:

* `FunctionChain` is being processed with non-zero
`UnscheduledPredecessors`
* Block `B'` is added to the `BlockWorkList`
* Block `B'` is chosen as the best successor (`selectBestSuccessor`) for
some another block and added into `Chain`
* Block `B'` is removed by tail duplicator.

`RemovalCallback` erroneously won't erase `B'` from `BlockWorkList`,
because `UnscheduledPredecessors` value of `FunctionChain` is not zero
(and it is allowed to be non-zero).

Proposed solution is to always cleanup worklists on block deletion by
tail duplicator.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Limit number of analyzed predecessors</title>
<updated>2025-06-20T09:23:00+00:00</updated>
<author>
<name>Alexis Engelke</name>
<email>engelke@in.tum.de</email>
</author>
<published>2025-06-20T09:23:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=61972054f3fcaf59096799342bac9c93dd9aa432'/>
<id>61972054f3fcaf59096799342bac9c93dd9aa432</id>
<content type='text'>
MachineBlockPlacement has quadratic runtime in the number of
predecessors: in some situation, for an edge, all predecessors of the
successor are considered.

Limit the number of considered predecessors to bound compile time for
large functions.

Pull Request: https://github.com/llvm/llvm-project/pull/142584
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MachineBlockPlacement has quadratic runtime in the number of
predecessors: in some situation, for an edge, all predecessors of the
successor are considered.

Limit the number of considered predecessors to bound compile time for
large functions.

Pull Request: https://github.com/llvm/llvm-project/pull/142584
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Use range constructors of *Set (NFC) (#137552)</title>
<updated>2025-04-27T22:59:57+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-04-27T22:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5cfd81b0cc9f92f3d4903f4e7b97769fe7b565b9'/>
<id>5cfd81b0cc9f92f3d4903f4e7b97769fe7b565b9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][NPM] Port MachineBlockPlacementStats to NPM (#129853)</title>
<updated>2025-04-17T09:54:46+00:00</updated>
<author>
<name>Akshat Oke</name>
<email>Akshat.Oke@amd.com</email>
</author>
<published>2025-04-17T09:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a09fd9c6536b746deea651b796978285ed161a00'/>
<id>a09fd9c6536b746deea651b796978285ed161a00</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Avoid repeated hash lookups (NFC) (#135584)</title>
<updated>2025-04-14T08:03:06+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-04-14T08:03:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ebd1667059e7b2865a8e419a21df4d4c9735869c'/>
<id>ebd1667059e7b2865a8e419a21df4d4c9735869c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][NPM] Port MachineBlockPlacement to NPM (#129828)</title>
<updated>2025-03-14T05:01:53+00:00</updated>
<author>
<name>Akshat Oke</name>
<email>Akshat.Oke@amd.com</email>
</author>
<published>2025-03-14T05:01:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=87916f8c32ebd8e284091db9b70339df57fd1e90'/>
<id>87916f8c32ebd8e284091db9b70339df57fd1e90</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Avoid repeated hash lookups (NFC) (#129652)</title>
<updated>2025-03-04T09:49:48+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-04T09:49:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ef94d8a0f2d885d1753cd39c1ea76fe21a69d93b'/>
<id>ef94d8a0f2d885d1753cd39c1ea76fe21a69d93b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Avoid repeated hash lookups (NFC) (#123894)</title>
<updated>2025-01-22T08:17:55+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-01-22T08:17:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19a7fe03b4f58c4f73ea91d5e63bc4c6e61f987b'/>
<id>19a7fe03b4f58c4f73ea91d5e63bc4c6e61f987b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLVM] Fix various cl::desc typos and whitespace issues (NFC) (#121955)</title>
<updated>2025-01-08T10:07:23+00:00</updated>
<author>
<name>Ryan Mansfield</name>
<email>ryan_mansfield@apple.com</email>
</author>
<published>2025-01-08T10:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67efbd0bf1b2df8a479e09eb2be7db4c3c892f2c'/>
<id>67efbd0bf1b2df8a479e09eb2be7db4c3c892f2c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeLayout] Do not rebuild chains with -apply-ext-tsp-for-size (#115934)</title>
<updated>2024-11-18T17:16:09+00:00</updated>
<author>
<name>Ellis Hoag</name>
<email>ellis.sparky.hoag@gmail.com</email>
</author>
<published>2024-11-18T17:16:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c9260e21d092c3acbb77bb9f6fcd0820f6a138c1'/>
<id>c9260e21d092c3acbb77bb9f6fcd0820f6a138c1</id>
<content type='text'>
https://github.com/llvm/llvm-project/pull/109711 disables
`buildCFGChains()` when `-apply-ext-tsp-for-size` is used to improve
codesize. Tail merging can change the layout and normally requires
`buildCFGChains()` to be called again, but we want to prevent this when
optimizing for codesize. We saw slight size improvement on large
binaries with this change. If `-apply-ext-tsp-for-size` is not used,
this should be a NFC.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/pull/109711 disables
`buildCFGChains()` when `-apply-ext-tsp-for-size` is used to improve
codesize. Tail merging can change the layout and normally requires
`buildCFGChains()` to be called again, but we want to prevent this when
optimizing for codesize. We saw slight size improvement on large
binaries with this change. If `-apply-ext-tsp-for-size` is not used,
this should be a NFC.</pre>
</div>
</content>
</entry>
</feed>
