<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/LiveRangeShrink.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>LiveRangeShrink: Early exit when encountering a code motion barrier.</title>
<updated>2025-04-24T19:44:51+00:00</updated>
<author>
<name>Peter Collingbourne</name>
<email>peter@pcc.me.uk</email>
</author>
<published>2025-04-24T19:44:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4ed8bfd0c3949dbf4e3042bd35eb274373e55cf7'/>
<id>4ed8bfd0c3949dbf4e3042bd35eb274373e55cf7</id>
<content type='text'>
Without this, we end up with quadratic behavior affecting functions with
large numbers of code motion barriers, such as CFI jump tables.

As a drive-by cleanup, remove a redundant store to SawStore in this
pass as it is also done by isSafeToMove.

Reviewers: arsenm

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/136806
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this, we end up with quadratic behavior affecting functions with
large numbers of code motion barriers, such as CFI jump tables.

As a drive-by cleanup, remove a redundant store to SawStore in this
pass as it is also done by isSafeToMove.

Reviewers: arsenm

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/136806
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Avoid repeated hash lookups (NFC) (#130889)</title>
<updated>2025-03-12T15:47:36+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-03-12T15:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=db3fdbc84beb9b1f60290880e87a0c7050ac814e'/>
<id>db3fdbc84beb9b1f60290880e87a0c7050ac814e</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 Register or MCRegister. NFC</title>
<updated>2025-03-06T17:08:21+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-03-06T16:56:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bdf50f029232d30e820dfc222bee8eecd3945155'/>
<id>bdf50f029232d30e820dfc222bee8eecd3945155</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen][X86] LiveRangeShrink: fix increment after end (#115276)</title>
<updated>2024-11-09T04:25:57+00:00</updated>
<author>
<name>Mirko</name>
<email>mirkomueller97@live.de</email>
</author>
<published>2024-11-09T04:25:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e02fd8d0b3c6638220c95e997c43fdc9d7ded3c'/>
<id>5e02fd8d0b3c6638220c95e997c43fdc9d7ded3c</id>
<content type='text'>
This fixes the infinite loop discovered in #114195. 
Since we skip debug instructions at the start of the loop we do not need
to skip them again at the end of the loop.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes the infinite loop discovered in #114195. 
Since we skip debug instructions at the start of the loop we do not need
to skip them again at the end of the loop.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Use first EHLabel as a stop gate for live range shrinking (#114195)</title>
<updated>2024-11-02T02:13:18+00:00</updated>
<author>
<name>Mirko</name>
<email>mirkomueller97@live.de</email>
</author>
<published>2024-11-02T02:13:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d3c427f339562b73938296d77103baf9ab9dc4b'/>
<id>4d3c427f339562b73938296d77103baf9ab9dc4b</id>
<content type='text'>
This fixes issue #114194

The issue happens during the `LiveRangeShrink` pass, which runs early,
before phi elimination. LandingPads, which are lowered to EHLabels, need
to be the first non phi instruction in an EHPad. In case of a phi node
being in front of the EHLabel and a use being after the EHLabel, we
hoist the use in front of the label.

This results in a portion of the landingpad missing due to being hoisted
in front of the label.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes issue #114194

The issue happens during the `LiveRangeShrink` pass, which runs early,
before phi elimination. LandingPads, which are lowered to EHLabels, need
to be the first non phi instruction in an EHPad. In case of a phi node
being in front of the EHLabel and a use being after the EHLabel, we
hoist the use in front of the label.

This results in a portion of the landingpad missing due to being hoisted
in front of the label.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Remove AA parameter of isSafeToMove (#100691)</title>
<updated>2024-07-26T07:47:47+00:00</updated>
<author>
<name>Pengcheng Wang</name>
<email>wangpengcheng.pp@bytedance.com</email>
</author>
<published>2024-07-26T07:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ed4e75d5e5ada30c37c57df032378a77e6dd598e'/>
<id>ed4e75d5e5ada30c37c57df032378a77e6dd598e</id>
<content type='text'>
This `AA` parameter is not used and for most uses they just pass
a nullptr.

The use of `AA` was removed since 8d0383e.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This `AA` parameter is not used and for most uses they just pass
a nullptr.

The use of `AA` was removed since 8d0383e.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[CodeGen]Allow targets to use target specific COPY instructions for live range splitting"</title>
<updated>2023-08-01T00:15:45+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2023-07-28T17:05:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d42e8b5d1fa87e49768d100dd1bc53515391e89'/>
<id>4d42e8b5d1fa87e49768d100dd1bc53515391e89</id>
<content type='text'>
This reverts commit a496c8be6e638ae58bb45f13113dbe3a4b7b23fd.

The workaround in c26dfc81e254c78dc23579cf3d1336f77249e1f6 should work
around the underlying problem with SUBREG_TO_REG.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit a496c8be6e638ae58bb45f13113dbe3a4b7b23fd.

The workaround in c26dfc81e254c78dc23579cf3d1336f77249e1f6 should work
around the underlying problem with SUBREG_TO_REG.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[CodeGen]Allow targets to use target specific COPY instructions for live range splitting"</title>
<updated>2023-07-27T05:13:32+00:00</updated>
<author>
<name>Vitaly Buka</name>
<email>vitalybuka@google.com</email>
</author>
<published>2023-07-26T22:41:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a496c8be6e638ae58bb45f13113dbe3a4b7b23fd'/>
<id>a496c8be6e638ae58bb45f13113dbe3a4b7b23fd</id>
<content type='text'>
And dependent commits.

Details in D150388.

This reverts commit 825b7f0ca5f2211ec3c93139f98d1e24048c225c.
This reverts commit 7a98f084c4d121244ef7286bc6503b6a181d446e.
This reverts commit b4a62b1fa546312d882fa12dfdcd015177d66826.
This reverts commit b7836d856206ec39509d42529f958c920368166b.

No conflicts in the code, few tests had conflicts in autogenerated CHECKs:
llvm/test/CodeGen/Thumb2/mve-float32regloops.ll
llvm/test/CodeGen/AMDGPU/fix-frame-reg-in-custom-csr-spills.ll

Reviewed By: alexfh

Differential Revision: https://reviews.llvm.org/D156381
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And dependent commits.

Details in D150388.

This reverts commit 825b7f0ca5f2211ec3c93139f98d1e24048c225c.
This reverts commit 7a98f084c4d121244ef7286bc6503b6a181d446e.
This reverts commit b4a62b1fa546312d882fa12dfdcd015177d66826.
This reverts commit b7836d856206ec39509d42529f958c920368166b.

No conflicts in the code, few tests had conflicts in autogenerated CHECKs:
llvm/test/CodeGen/Thumb2/mve-float32regloops.ll
llvm/test/CodeGen/AMDGPU/fix-frame-reg-in-custom-csr-spills.ll

Reviewed By: alexfh

Differential Revision: https://reviews.llvm.org/D156381
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen]Allow targets to use target specific COPY instructions for live range splitting</title>
<updated>2023-07-07T16:59:50+00:00</updated>
<author>
<name>Yashwant Singh</name>
<email>Yashwant.Singh@amd.com</email>
</author>
<published>2023-07-07T16:59:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b7836d856206ec39509d42529f958c920368166b'/>
<id>b7836d856206ec39509d42529f958c920368166b</id>
<content type='text'>
Replacing D143754. Right now the LiveRangeSplitting during register allocation uses
TargetOpcode::COPY instruction for splitting. For AMDGPU target that creates a
problem as we have both vector and scalar copies. Vector copies perform a copy over
a vector register but only on the lanes(threads) that are active. This is mostly sufficient
however we do run into cases when we have to copy the entire vector register and
not just active lane data. One major place where we need that is live range splitting.

Allowing targets to use their own copy instructions(if defined) will provide a lot of
flexibility and ease to lower these pseudo instructions to correct MIR.

- Introduce getTargetCopyOpcode() virtual function and use if to generate copy in Live range
 splitting.
- Replace necessary MI.isCopy() checks with TII.isCopyInstr() in register allocator pipeline.

Reviewed By: arsenm, cdevadas, kparzysz

Differential Revision: https://reviews.llvm.org/D150388
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replacing D143754. Right now the LiveRangeSplitting during register allocation uses
TargetOpcode::COPY instruction for splitting. For AMDGPU target that creates a
problem as we have both vector and scalar copies. Vector copies perform a copy over
a vector register but only on the lanes(threads) that are active. This is mostly sufficient
however we do run into cases when we have to copy the entire vector register and
not just active lane data. One major place where we need that is live range splitting.

Allowing targets to use their own copy instructions(if defined) will provide a lot of
flexibility and ease to lower these pseudo instructions to correct MIR.

- Introduce getTargetCopyOpcode() virtual function and use if to generate copy in Live range
 splitting.
- Replace necessary MI.isCopy() checks with TII.isCopyInstr() in register allocator pipeline.

Reviewed By: arsenm, cdevadas, kparzysz

Differential Revision: https://reviews.llvm.org/D150388
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Remove uses of Register::isPhysicalRegister/isVirtualRegister. NFC</title>
<updated>2023-01-13T22:38:08+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2023-01-13T22:38:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e72ca520bb4806d4003ef69698089fd83a5777cb'/>
<id>e72ca520bb4806d4003ef69698089fd83a5777cb</id>
<content type='text'>
Use isPhysical/isVirtual methods.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D141715
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use isPhysical/isVirtual methods.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D141715
</pre>
</div>
</content>
</entry>
</feed>
