This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Prepare for introduction of v3 and v5 MVTs
ClosedPublic

Authored by tpr on Mar 4 2019, 3:16 PM.

Details

Summary

AMDGPU would like to have MVTs for v3i32, v3f32, v5i32, v5f32. This
commit does not add them, but makes preparatory changes:

  • Fixed assumptions of power-of-2 vector type in kernel arg handling, and added v5 kernel arg tests.
  • Added v5 tests for cost analysis.

Some of this patch is from Matt Arsenault, also of AMD.

Change-Id: I7279d6b4841464d2080eb255ef3c589e268eabcd

Diff Detail

Repository
rL LLVM

Event Timeline

tpr created this revision.Mar 4 2019, 3:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2019, 3:16 PM
rampitec added inline comments.Mar 4 2019, 3:37 PM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1036 ↗(On Diff #189215)

It will be an empty block in release and compiler will complain.

tpr updated this revision to Diff 189292.Mar 5 2019, 3:25 AM

V2: Addressed Stas's review comment about empty block.

tpr marked an inline comment as done.Mar 5 2019, 3:26 AM
arsenm added a comment.Mar 5 2019, 8:26 AM

Could also use the vector tests for the shader arguments

test/CodeGen/AMDGPU/kernel-args.ll
443 ↗(On Diff #189292)

i64/f64

tpr added a comment.Mar 11 2019, 4:48 AM

Could also use the vector tests for the shader arguments

Could you explain what you're suggesting I do please?

tpr updated this revision to Diff 190071.Mar 11 2019, 5:06 AM

V3: Fixed new cost tests so they work with and without legal v3/v5
types. Added v5i64/v5f64 kernarg test cases as suggested by Matt.

tpr marked an inline comment as done.Mar 11 2019, 5:07 AM
In D58928#1424393, @tpr wrote:

Could also use the vector tests for the shader arguments

Could you explain what you're suggesting I do please?

You added tests for kernel arguments, but the calling convention lowering path is quite different for regular functions as well as shaders. The tests for the othercalling convention argument types should also be tested. V3 may already be tested, but v5 probably is not

tpr updated this revision to Diff 190448.Mar 13 2019, 10:39 AM

V4: Added vec3/vec5 shader arg test cases.

Missed call-argument-types.ll/call-return-types.ll. These have tests for <3 x i32>/<3 x float>, but missing the 5xs. Those could also use some byval/sret, and stack passed cases since I suspect they are going to break since we have to maintain a list of specific MVTs for those

tpr updated this revision to Diff 190983.Mar 16 2019, 11:49 AM

V5: Added vec3/vec5 non-shader arg and ret type test cases, including passing by stack.

arsenm accepted this revision.Mar 16 2019, 12:39 PM

LGTM

This revision is now accepted and ready to land.Mar 16 2019, 12:39 PM
This revision was automatically updated to reflect the committed changes.