<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/AMDGPU/AMDGPUCallingConv.td, 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>[AMDGPU] Change SGPR layout to striped caller/callee saved (#127353)</title>
<updated>2025-03-08T14:28:20+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>i@tianshilei.me</email>
</author>
<published>2025-03-08T14:28:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a779af3f882e1500ee6b9cb973e60c10ea0819b4'/>
<id>a779af3f882e1500ee6b9cb973e60c10ea0819b4</id>
<content type='text'>
This PR updates the SGPR layout to a striped caller/callee-saved design,
similar
to the VGPR layout.

To ensure that s30-s31 (return address), s32 (stack pointer), s33 (frame
pointer), and s34 (base pointer) remain callee-saved, the striped layout
starts
from s40, with a stripe width of 8. The last stripe is 10 wide instead
of 8 to
avoid ending with a 2-wide stripe.

Fixes #113782.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR updates the SGPR layout to a striped caller/callee-saved design,
similar
to the VGPR layout.

To ensure that s30-s31 (return address), s32 (stack pointer), s33 (frame
pointer), and s34 (base pointer) remain callee-saved, the striped layout
starts
from s40, with a stripe width of 8. The last stripe is 10 wide instead
of 8 to
avoid ending with a 2-wide stripe.

Fixes #113782.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][AMDGPU] Use `!foreach` to replace explicit list of registers (#114005)</title>
<updated>2024-10-29T14:50:06+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>i@tianshilei.me</email>
</author>
<published>2024-10-29T14:50:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e268398fa89c9cc7901ea9b7386fc693023be203'/>
<id>e268398fa89c9cc7901ea9b7386fc693023be203</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Target] Use templated MachineFunction::getSubtarget in *CallingConv.td. NFC (#107311)</title>
<updated>2024-09-05T06:15:25+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2024-09-05T06:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aafaa6943463b56db2928081dc72b116e246c249'/>
<id>aafaa6943463b56db2928081dc72b116e246c249</id>
<content type='text'>
This hides away the static_cast needed to get the target specific Subtarget
object.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This hides away the static_cast needed to get the target specific Subtarget
object.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Update amdgpu_gfx functions to use s0-s3 for inreg SGPR arguments on targets using scratch instructions for stack #78226" (#86273)</title>
<updated>2024-03-26T10:01:08+00:00</updated>
<author>
<name>Thomas Symalla</name>
<email>5754458+tsymalla@users.noreply.github.com</email>
</author>
<published>2024-03-26T10:01:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=256343a0e919bc09f65a8ee26751b561fa2dbfc1'/>
<id>256343a0e919bc09f65a8ee26751b561fa2dbfc1</id>
<content type='text'>
Reverts llvm/llvm-project#81394

This reverts commit 3ac243bc0d7922d083af2cf025247b5698556062.
It is not handling RSrc registers s0-s3 correctly. This leads to a
broken test, where it expects s0-s3 as function argument and uses it as
RSrc register as well.
We need to re-visit the patch, but apparently we only want to have s0-s3
as
argument registers if we don't need them as RSrc registers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#81394

This reverts commit 3ac243bc0d7922d083af2cf025247b5698556062.
It is not handling RSrc registers s0-s3 correctly. This leads to a
broken test, where it expects s0-s3 as function argument and uses it as
RSrc register as well.
We need to re-visit the patch, but apparently we only want to have s0-s3
as
argument registers if we don't need them as RSrc registers.</pre>
</div>
</content>
</entry>
<entry>
<title>Update amdgpu_gfx functions to use s0-s3 for inreg SGPR arguments on targets using scratch instructions for stack #78226 (#81394)</title>
<updated>2024-03-21T11:22:08+00:00</updated>
<author>
<name>SahilPatidar</name>
<email>patidarsahil2001@gmail.com</email>
</author>
<published>2024-03-21T11:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3ac243bc0d7922d083af2cf025247b5698556062'/>
<id>3ac243bc0d7922d083af2cf025247b5698556062</id>
<content type='text'>
Resolve #78226</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Resolve #78226</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] promote i1 arg type for amdgpu_cs (#82971)</title>
<updated>2024-03-01T08:55:46+00:00</updated>
<author>
<name>Nick Anderson</name>
<email>nickleus27@gmail.com</email>
</author>
<published>2024-03-01T08:55:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ba8e9ace13c3c2dedf5c496455de822cba931862'/>
<id>ba8e9ace13c3c2dedf5c496455de822cba931862</id>
<content type='text'>
fixes #68087 
Not sure where to put regression tests for this pr? Also, should i1 args
not in reg also be promoted?</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fixes #68087 
Not sure where to put regression tests for this pr? Also, should i1 args
not in reg also be promoted?</pre>
</div>
</content>
</entry>
<entry>
<title>AMDGPU: Make bf16/v2bf16 legal types (#76215)</title>
<updated>2024-01-04T15:31:18+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2024-01-04T15:31:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=460ffcddd900b7a869a34790888e3075c6ec6549'/>
<id>460ffcddd900b7a869a34790888e3075c6ec6549</id>
<content type='text'>
There are some intrinsics are using i16 vectors in place of bfloat
vectors.
Move towards making bf16 vectors legal so these can migrate. Leave the
larger vectors for a later change.

Depends #76213 #76214</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are some intrinsics are using i16 vectors in place of bfloat
vectors.
Move towards making bf16 vectors legal so these can migrate. Leave the
larger vectors for a later change.

Depends #76213 #76214</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] Add inreg support for SGPR arguments (#67182)</title>
<updated>2023-11-08T19:35:52+00:00</updated>
<author>
<name>Jun Wang</name>
<email>jwang86@yahoo.com</email>
</author>
<published>2023-11-08T19:35:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=54470176afe20b16e6b026ab989591d1d19ad2b7'/>
<id>54470176afe20b16e6b026ab989591d1d19ad2b7</id>
<content type='text'>
Function parameters marked with inreg are supposed to be allocated to
SGPRs. However, for compute functions, this is ignored and function
parameters are allocated to VGPRs. This fix modifies CC_AMDGPU_Func in
AMDGPUCallingConv.td to use SGPRs if input arg is marked inreg.
---------

Co-authored-by: Jun Wang &lt;jun.wang7@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Function parameters marked with inreg are supposed to be allocated to
SGPRs. However, for compute functions, this is ignored and function
parameters are allocated to VGPRs. This fix modifies CC_AMDGPU_Func in
AMDGPUCallingConv.td to use SGPRs if input arg is marked inreg.
---------

Co-authored-by: Jun Wang &lt;jun.wang7@amd.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] Callee saves for amdgpu_cs_chain[_preserve] (#71526)</title>
<updated>2023-11-08T07:28:15+00:00</updated>
<author>
<name>Diana</name>
<email>Diana-Magda.Picus@amd.com</email>
</author>
<published>2023-11-08T07:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1fa58c7790ee36591326d3bebcb417b3c4b06e37'/>
<id>1fa58c7790ee36591326d3bebcb417b3c4b06e37</id>
<content type='text'>
Teach prolog epilog insertion how to handle functions with the
amdgpu_cs_chain or amdgpu_cs_chain_preserve calling conventions.

For amdgpu_cs_chain functions, we only need to preserve the inactive
lanes of VGPRs above v8, and only in the presence of calls via
@llvm.amdgcn.cs.chain.

For amdgpu_cs_chain_preserve functions, we will also need to preserve
the active lanes for registers above the last argument VGPR. AFAICT
there's no direct way to find out what the last argument VGPR is, so
instead the patch uses the fact that chain calls from
amdgpu_cs_chain_preserve functions can't use more VGPRs than the
caller's VGPR arguments. In other words, it removes the operands of
SI_CS_CHAIN_TC instructions from the list of callee saved registers.

For both calling conventions, registers v0-v7 never need to be saved and
restored, so we should never add them as WWM spills.

Differential Revision: https://reviews.llvm.org/D156412</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Teach prolog epilog insertion how to handle functions with the
amdgpu_cs_chain or amdgpu_cs_chain_preserve calling conventions.

For amdgpu_cs_chain functions, we only need to preserve the inactive
lanes of VGPRs above v8, and only in the presence of calls via
@llvm.amdgcn.cs.chain.

For amdgpu_cs_chain_preserve functions, we will also need to preserve
the active lanes for registers above the last argument VGPR. AFAICT
there's no direct way to find out what the last argument VGPR is, so
instead the patch uses the fact that chain calls from
amdgpu_cs_chain_preserve functions can't use more VGPRs than the
caller's VGPR arguments. In other words, it removes the operands of
SI_CS_CHAIN_TC instructions from the list of callee saved registers.

For both calling conventions, registers v0-v7 never need to be saved and
restored, so we should never add them as WWM spills.

Differential Revision: https://reviews.llvm.org/D156412</pre>
</div>
</content>
</entry>
<entry>
<title>[AMDGPU] ISel for amdgpu_cs_chain[_preserve] functions</title>
<updated>2023-08-21T09:16:17+00:00</updated>
<author>
<name>Diana Picus</name>
<email>Diana-Magda.Picus@amd.com</email>
</author>
<published>2023-05-30T11:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=26dc2844984204bb91245f6af6b9a685da47a9a5'/>
<id>26dc2844984204bb91245f6af6b9a685da47a9a5</id>
<content type='text'>
Lower formal arguments and returns for functions with the
`amdgpu_cs_chain` and `amdgpu_cs_chain_preserve` calling conventions:

* Put `inreg` arguments into SGPRs, starting at s0, and other arguments
into VGPRs, starting at v8. No arguments should end up on the stack, if
we don't have enough registers we should error out.

* Lower the return (which is always void) as an S_ENDPGM.

* Set the ScratchRSrc register to s48:51, as described in the docs.

* Set the SP to s32, matching amdgpu_gfx. This might be revisited in a
future patch.

Differential Revision: https://reviews.llvm.org/D153517
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lower formal arguments and returns for functions with the
`amdgpu_cs_chain` and `amdgpu_cs_chain_preserve` calling conventions:

* Put `inreg` arguments into SGPRs, starting at s0, and other arguments
into VGPRs, starting at v8. No arguments should end up on the stack, if
we don't have enough registers we should error out.

* Lower the return (which is always void) as an S_ENDPGM.

* Set the ScratchRSrc register to s48:51, as described in the docs.

* Set the SP to s32, matching amdgpu_gfx. This might be revisited in a
future patch.

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