<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/RegAllocFast.cpp, branch users/shawbyoung/spr/main.boltnfc-refactoring-callgraph</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][NewPM] Extract MachineFunctionProperties modification part to an RAII class (#94854)</title>
<updated>2024-06-22T09:34:03+00:00</updated>
<author>
<name>paperchalice</name>
<email>liujunchang97@outlook.com</email>
</author>
<published>2024-06-22T09:34:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8e9c6bfb5075a498344521d5911b6bc9ab9c901f'/>
<id>8e9c6bfb5075a498344521d5911b6bc9ab9c901f</id>
<content type='text'>
Modify MachineFunctionProperties in PassModel makes `PassT P;
P.run(...);` not work properly. This is a necessary compromise.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify MachineFunctionProperties in PassModel makes `PassT P;
P.run(...);` not work properly. This is a necessary compromise.</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAllocFast] Replace UsedInInstr with vector (#96323)</title>
<updated>2024-06-21T17:35:29+00:00</updated>
<author>
<name>Alexis Engelke</name>
<email>engelke@in.tum.de</email>
</author>
<published>2024-06-21T17:35:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f4cf15d225fdaf98c106a4adfae57dae509607ff'/>
<id>f4cf15d225fdaf98c106a4adfae57dae509607ff</id>
<content type='text'>
A SparseSet adds an avoidable layer of indirection and possibly looping
control flow. Avoid this overhead by using a vector to store
UsedInInstrs and PhysRegUses.

To avoid clearing the vector after every instruction, use a
monotonically increasing counter. The two maps are now merged and the
lowest bit indicates whether the use is relevant for the livethrough
handling code only.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A SparseSet adds an avoidable layer of indirection and possibly looping
control flow. Avoid this overhead by using a vector to store
UsedInInstrs and PhysRegUses.

To avoid clearing the vector after every instruction, use a
monotonically increasing counter. The two maps are now merged and the
lowest bit indicates whether the use is relevant for the livethrough
handling code only.
</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAlloc] Don't call always-true ShouldAllocClass (#96296)</title>
<updated>2024-06-21T11:18:35+00:00</updated>
<author>
<name>Alexis Engelke</name>
<email>engelke@in.tum.de</email>
</author>
<published>2024-06-21T11:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=739a9605677dd736971b17a7888f9d18fd245904'/>
<id>739a9605677dd736971b17a7888f9d18fd245904</id>
<content type='text'>
Previously, there was at least one virtual function call for every
allocated register. The only users of this feature are AMDGPU and RISC-V
(RVV), other targets don't use this. To easily identify these cases,
change the default functor to nullptr and don't call it for every
allocated register.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, there was at least one virtual function call for every
allocated register. The only users of this feature are AMDGPU and RISC-V
(RVV), other targets don't use this. To easily identify these cases,
change the default functor to nullptr and don't call it for every
allocated register.
</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAllocFast] Handle single-vdef instrs faster (#96284)</title>
<updated>2024-06-21T10:30:59+00:00</updated>
<author>
<name>Alexis Engelke</name>
<email>engelke@in.tum.de</email>
</author>
<published>2024-06-21T10:30:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0ae6cfc5990b0b739166bd7db370125ca66494c2'/>
<id>0ae6cfc5990b0b739166bd7db370125ca66494c2</id>
<content type='text'>
On x86, many instructions have tied operands, so allocateInstruction
uses the more complex assignment strategy, which computes the assignment
order of virtual defs first. This involves iterating over all register
classes (or register aliases for physical defs) to compute the possible
number of defs per register class.

However, this information is only used for sorting virtual defs and
therefore not required when there's only one virtual def -- which is a
very common case. As iterating over all register classes/aliases is not
cheap, do this only when there's more than one virtual def.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On x86, many instructions have tied operands, so allocateInstruction
uses the more complex assignment strategy, which computes the assignment
order of virtual defs first. This involves iterating over all register
classes (or register aliases for physical defs) to compute the possible
number of defs per register class.

However, this information is only used for sorting virtual defs and
therefore not required when there's only one virtual def -- which is a
very common case. As iterating over all register classes/aliases is not
cheap, do this only when there's more than one virtual def.
</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAllocFast] Use unsigned for operand indices</title>
<updated>2024-06-21T10:25:28+00:00</updated>
<author>
<name>Alexis Engelke</name>
<email>engelke@in.tum.de</email>
</author>
<published>2024-06-21T08:30:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cba4dfdd2fd0515821459b50947f4ec0d8b5c58a'/>
<id>cba4dfdd2fd0515821459b50947f4ec0d8b5c58a</id>
<content type='text'>
MachineInstr operand indices can be up 24 bits currently. Use unsigned
as consistent data type for operand indices instead of uint16_t.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MachineInstr operand indices can be up 24 bits currently. Use unsigned
as consistent data type for operand indices instead of uint16_t.
</pre>
</div>
</content>
</entry>
<entry>
<title>[NewPM][CodeGen] Port `regallocfast` to new pass manager (#94426)</title>
<updated>2024-06-07T04:22:42+00:00</updated>
<author>
<name>paperchalice</name>
<email>liujunchang97@outlook.com</email>
</author>
<published>2024-06-07T04:22:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1bc8b3258e6d42f702fb11eb60d84d0e23935e3e'/>
<id>1bc8b3258e6d42f702fb11eb60d84d0e23935e3e</id>
<content type='text'>
This pull request port `regallocfast` to new pass manager. It exposes
the parameter `filter` to handle different register classes for AMDGPU.
IIUC AMDGPU need to allocate different register classes separately so it
need implement its own `--&lt;reg-class&gt;-regalloc`. Now users can use e.g.
`-passe=regallocfast&lt;filter=sgpr&gt;` to allocate specific register class.
The command line option `--regalloc-npm` is still in work progress, plan
to reuse the syntax of passes, e.g. use
`--regalloc-npm=regallocfast&lt;filter=sgpr&gt;,greedy&lt;filter=vgpr&gt;` to
replace `--sgpr-regalloc` and `--vgpr-regalloc`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pull request port `regallocfast` to new pass manager. It exposes
the parameter `filter` to handle different register classes for AMDGPU.
IIUC AMDGPU need to allocate different register classes separately so it
need implement its own `--&lt;reg-class&gt;-regalloc`. Now users can use e.g.
`-passe=regallocfast&lt;filter=sgpr&gt;` to allocate specific register class.
The command line option `--regalloc-npm` is still in work progress, plan
to reuse the syntax of passes, e.g. use
`--regalloc-npm=regallocfast&lt;filter=sgpr&gt;,greedy&lt;filter=vgpr&gt;` to
replace `--sgpr-regalloc` and `--vgpr-regalloc`.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Do not pass MF into MachineRegisterInfo methods. NFC. (#84770)</title>
<updated>2024-03-11T15:35:05+00:00</updated>
<author>
<name>Jay Foad</name>
<email>jay.foad@amd.com</email>
</author>
<published>2024-03-11T15:35:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=63a5dc4aedaf8a4b26e536afb22612b4d69100bf'/>
<id>63a5dc4aedaf8a4b26e536afb22612b4d69100bf</id>
<content type='text'>
MachineRegisterInfo already knows the MF so there is no need to pass it
in as an argument.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MachineRegisterInfo already knows the MF so there is no need to pass it
in as an argument.</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAllocFast] Lazily initialize InstrPosIndexes for each MBB (#76275)</title>
<updated>2023-12-25T01:42:31+00:00</updated>
<author>
<name>HaohaiWen</name>
<email>haohai.wen@intel.com</email>
</author>
<published>2023-12-25T01:42:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=536b043219e75976888bd77f6063b02ebb6ffdb9'/>
<id>536b043219e75976888bd77f6063b02ebb6ffdb9</id>
<content type='text'>
Most basic block do not need to query dominates. Defer initialization of
InstrPosIndexes to first query for each MBB.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most basic block do not need to query dominates. Defer initialization of
InstrPosIndexes to first query for each MBB.</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAllocFast] Avoid duplicate hash lookup (NFC)</title>
<updated>2023-12-22T15:52:20+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-12-22T15:52:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d82eccc7524622e482d3dab2219651587eb93429'/>
<id>d82eccc7524622e482d3dab2219651587eb93429</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[RegAllocFast] Refactor dominates algorithm for large basic block (#72250)</title>
<updated>2023-12-22T15:06:16+00:00</updated>
<author>
<name>HaohaiWen</name>
<email>haohai.wen@intel.com</email>
</author>
<published>2023-12-22T15:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=40ec791b15b0110785a91b057e95535e8b0989b6'/>
<id>40ec791b15b0110785a91b057e95535e8b0989b6</id>
<content type='text'>
The original brute force dominates algorithm is O(n) complexity so it is
very slow for very large machine basic block which is very common with
O0. This patch added InstrPosIndexes to assign index for each
instruction and use it to determine dominance. The complexity is now
O(1).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The original brute force dominates algorithm is O(n) complexity so it is
very slow for very large machine basic block which is very common with
O0. This patch added InstrPosIndexes to assign index for each
instruction and use it to determine dominance. The complexity is now
O(1).</pre>
</div>
</content>
</entry>
</feed>
