<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/LiveIntervals.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] Turn MCRegUnit into an enum class (NFC) (#167943)</title>
<updated>2025-11-16T17:46:44+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2025-11-16T17:46:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=97a60aa37a048155fec0c560fc51ed52dbd84e44'/>
<id>97a60aa37a048155fec0c560fc51ed52dbd84e44</id>
<content type='text'>
This changes `MCRegUnit` type from `unsigned` to `enum class : unsigned`
and inserts necessary casts.
The added `MCRegUnitToIndex` functor is used with `SparseSet`,
`SparseMultiSet` and `IndexedMap` in a few places.

`MCRegUnit` is opaque to users, so it didn't seem worth making it a
full-fledged class like `Register`.

Static type checking has detected one issue in
`PrologueEpilogueInserter.cpp`, where `BitVector` created for
`MCRegister` is indexed by both `MCRegister` and `MCRegUnit`.

The number of casts could be reduced by using `IndexedMap` in more
places and/or adding a `BitVector` adaptor, but the number of casts *per
file* is still small and `IndexedMap` has limitations, so it didn't seem
worth the effort.

Pull Request: https://github.com/llvm/llvm-project/pull/167943</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes `MCRegUnit` type from `unsigned` to `enum class : unsigned`
and inserts necessary casts.
The added `MCRegUnitToIndex` functor is used with `SparseSet`,
`SparseMultiSet` and `IndexedMap` in a few places.

`MCRegUnit` is opaque to users, so it didn't seem worth making it a
full-fledged class like `Register`.

Static type checking has detected one issue in
`PrologueEpilogueInserter.cpp`, where `BitVector` created for
`MCRegister` is indexed by both `MCRegister` and `MCRegUnit`.

The number of casts could be reduced by using `IndexedMap` in more
places and/or adding a `BitVector` adaptor, but the number of casts *per
file* is still small and `IndexedMap` has limitations, so it didn't seem
worth the effort.

Pull Request: https://github.com/llvm/llvm-project/pull/167943</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Add TRI::regunits() iterating over all register units (NFC) (#167901)</title>
<updated>2025-11-13T17:27:35+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2025-11-13T17:27:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d1cc1376a08f23eebc74f564782862e19958d786'/>
<id>d1cc1376a08f23eebc74f564782862e19958d786</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Use MCRegUnit in more places (NFC) (#167578)</title>
<updated>2025-11-11T22:08:50+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2025-11-11T22:08:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10679307189fb5b51980acd33ae14d70345c6c75'/>
<id>10679307189fb5b51980acd33ae14d70345c6c75</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[RegisterCoalescer] Prune live range of early-clobber from live-in (#157628)</title>
<updated>2025-10-14T18:44:18+00:00</updated>
<author>
<name>Hongyu Chen</name>
<email>xxs_chy@outlook.com</email>
</author>
<published>2025-10-14T18:44:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=975fba1b499422713e88cd6f374569f3bd38335e'/>
<id>975fba1b499422713e88cd6f374569f3bd38335e</id>
<content type='text'>
Fixes #134424
Fixes #71023
Refer to the context of #71024, when RegisterCoalescer tries to merge
`early-clobber %1:vr = PseudoVRGATHER_VI_M1 undef %1, ...`, JoinVals
reports `CR_Replace` as the conflict with `undef` can be ignored.
However, when pruning values, we need to remove any live ranges that
overlap a `CR_Replace` resolution. `LiveIntervals::pruneValue` missed
pruning the early-clobber part of the live ranges. This patch implements
it by removing the ranges from live-in.
I am not familiar with the RegisterCoalescer component. Any advice is
appreciated.
https://github.com/llvm/llvm-project/issues/156249 seems to be related,
but not resolved with this patch. I am still investigating.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #134424
Fixes #71023
Refer to the context of #71024, when RegisterCoalescer tries to merge
`early-clobber %1:vr = PseudoVRGATHER_VI_M1 undef %1, ...`, JoinVals
reports `CR_Replace` as the conflict with `undef` can be ignored.
However, when pruning values, we need to remove any live ranges that
overlap a `CR_Replace` resolution. `LiveIntervals::pruneValue` missed
pruning the early-clobber part of the live ranges. This patch implements
it by removing the ranges from live-in.
I am not familiar with the RegisterCoalescer component. Any advice is
appreciated.
https://github.com/llvm/llvm-project/issues/156249 seems to be related,
but not resolved with this patch. I am still investigating.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][LLVM][CodeGen] Namespace related cleanups (#162999)</title>
<updated>2025-10-13T14:54:50+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2025-10-13T14:54:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a4f5b2751efbddd7bfe9818ab9ea57d03a13752'/>
<id>2a4f5b2751efbddd7bfe9818ab9ea57d03a13752</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Introduce a VirtRegOrUnit class to hold virtual reg or physical reg unit. NFC (#123768)</title>
<updated>2025-01-25T02:30:28+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-01-25T02:30:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ac1ba1f9dd7013852cd27f514467f57ee0e6ed16'/>
<id>ac1ba1f9dd7013852cd27f514467f57ee0e6ed16</id>
<content type='text'>
LiveIntervals and MachineVerifier were previously using Register to
store this, but reg units are different than physical registers. One
important difference is that 0 is a valid reg unit number, but it is not
a valid phyiscal register.

This patch introduces a new VirtRegOrUnit class that is distinct from
Register. It can be be converted to/from a virtual Register or a
MCRegUnit. I've made all conversions explicit and used assertions to
check the validity.

I also fixed a place in MachineVerifier that was ignoring reg unit 0.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LiveIntervals and MachineVerifier were previously using Register to
store this, but reg units are different than physical registers. One
important difference is that 0 is a valid reg unit number, but it is not
a valid phyiscal register.

This patch introduces a new VirtRegOrUnit class that is distinct from
Register. It can be be converted to/from a virtual Register or a
MCRegUnit. I've made all conversions explicit and used assertions to
check the validity.

I also fixed a place in MachineVerifier that was ignoring reg unit 0.</pre>
</div>
</content>
</entry>
<entry>
<title>[NewPM] LiveIntervals: Check dependencies for invalidation (#123563)</title>
<updated>2025-01-24T05:53:46+00:00</updated>
<author>
<name>Akshat Oke</name>
<email>Akshat.Oke@amd.com</email>
</author>
<published>2025-01-24T05:53:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a9c61e0d7655a11f45f8e94b9481193fba11302e'/>
<id>a9c61e0d7655a11f45f8e94b9481193fba11302e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][PM] Initialize analyses with isAnalysis=true (#118779)</title>
<updated>2024-12-06T09:55:54+00:00</updated>
<author>
<name>Akshat Oke</name>
<email>Akshat.Oke@amd.com</email>
</author>
<published>2024-12-06T09:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=49abcd207fe26ea0fc7170e66f1b0b22f1d853d3'/>
<id>49abcd207fe26ea0fc7170e66f1b0b22f1d853d3</id>
<content type='text'>
Analyses should be marked as analyses.

Otherwise they are prone to get ignored by the legacy analysis cache mechanism and get scheduled redundantly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Analyses should be marked as analyses.

Otherwise they are prone to get ignored by the legacy analysis cache mechanism and get scheduled redundantly.</pre>
</div>
</content>
</entry>
<entry>
<title>[LiveIntervals] Ignore artificial regs when adding kill flags (#116963)</title>
<updated>2024-12-04T20:25:31+00:00</updated>
<author>
<name>Sander de Smalen</name>
<email>sander.desmalen@arm.com</email>
</author>
<published>2024-12-04T20:25:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=048fc2bc102cff806613592829ff275c0f2b826f'/>
<id>048fc2bc102cff806613592829ff275c0f2b826f</id>
<content type='text'>
If parts of a physical register for a given liverange, as assigned by
the register allocator, can be used to store other values not
represented by this liverange, then `LiveIntervals::addKillFlags`
normally avoids adding a kill flag on the use of this register
when the value's liverange ends.

However, if all the other regunits are artificial, then we can
still safely add the kill flag, since those parts of the register
can never be accessed independently.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If parts of a physical register for a given liverange, as assigned by
the register allocator, can be used to store other values not
represented by this liverange, then `LiveIntervals::addKillFlags`
normally avoids adding a kill flag on the use of this register
when the value's liverange ends.

However, if all the other regunits are artificial, then we can
still safely add the kill flag, since those parts of the register
can never be accessed independently.</pre>
</div>
</content>
</entry>
<entry>
<title>Check hasOptSize() in shouldOptimizeForSize() (#112626)</title>
<updated>2024-10-28T16:45:03+00:00</updated>
<author>
<name>Ellis Hoag</name>
<email>ellis.sparky.hoag@gmail.com</email>
</author>
<published>2024-10-28T16:45:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6ab26eab4f1e06f2da7b3183c55666ad57f8866e'/>
<id>6ab26eab4f1e06f2da7b3183c55666ad57f8866e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
