[PATCHES] AMDGPU/SI function return values

Marek Olšák via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 08:53:54 PST 2016


Hi,

I'm giving up on Phabricator right now. Maybe "arc" will be more
usable with git one day.

These are the patches for return value support that I'd like to
commit. The idea is simple - i32 returns values map to SGPRs, f32 map
to VGPRs. E.g. {i32, f32, i32} maps to {s0, v0, s1}.

Mesa will use this to generate independent parts of shaders and
concatenate them as needed. Therefore, not only do we need arbitrary
SGPR and VGPR inputs, but also outputs. The number of inputs and
outputs varies depending on requirements of each shader part.

The last patch (lit tests) can't land yet, because
getCopyToReg(ConstantSDNode) is translated to V_MOV, which breaks SGPR
outputs. This can be fixed in several different ways (e.g. in
instruction selection or CopyToReg operand legalization).

There is also a bug in SIFoldOperands, which sometimes generates
completely wrong code with return values.

Still, I'd like patches 1-6 to land. Patch 7 can land after the
CopyToReg bug is fixed.

Please review.

Thanks,
Marek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AMDGPU-SI-Add-new-target-attribute-InitialPSInputAdd.patch
Type: text/x-patch
Size: 7031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-AMDGPU-SI-Allow-any-number-of-PS-inputs.patch
Type: text/x-patch
Size: 1087 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-AMDGPU-SI-Allow-more-shader-inputs.patch
Type: text/x-patch
Size: 3602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-AMDGPU-SI-Add-support-for-non-void-functions.patch
Type: text/x-patch
Size: 9256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-AMDGPU-SI-Add-s_waitcnt-at-the-end-of-non-void-funct.patch
Type: text/x-patch
Size: 3352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-AMDGPU-SI-Remove-ending-s_endpgm-from-non-void-funct.patch
Type: text/x-patch
Size: 1119 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-AMDGPU-SI-Add-tests-for-non-void-functions-and-Initi.patch
Type: text/x-patch
Size: 8334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/df63e2f6/attachment-0006.bin>


More information about the llvm-commits mailing list