This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Remove error check for indirect calls and add missing queue-ptr
ClosedPublic

Authored by madhur13490 on Apr 16 2021, 3:26 AM.

Details

Summary

This patch removes -fixed-abi check for indirect calls
and also adds queue-ptr which is required for indirect calls to work.

Diff Detail

Event Timeline

madhur13490 created this revision.Apr 16 2021, 3:26 AM
madhur13490 requested review of this revision.Apr 16 2021, 3:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2021, 3:26 AM
madhur13490 added inline comments.
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
2961

Calling specific attention to this:
For AMDPAL, do we want indirect functions to work *only* when -fixed-abi is provided?
What are the cases for which we want to error out?

arsenm added inline comments.Apr 16 2021, 10:30 AM
llvm/test/CodeGen/AMDGPU/check-simple-indirect-call.ll
1 ↗(On Diff #338048)

Should use a concrete subtarget

3 ↗(On Diff #338048)

Should just merge this into the existing indirect call test

keep tests alone as discussed offline and add explicit subtarget to test

remove new test and merge in existing one

lebedev.ri retitled this revision from Remove error check for indirect calls and add missing queue-ptr to [AMDGPU] Remove error check for indirect calls and add missing queue-ptr.Apr 19 2021, 11:59 AM
arsenm accepted this revision.Apr 19 2021, 12:00 PM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
42–44

Why bother with the alloca/addrspacecast? This ends up getting optimized to LDS anyway

This revision is now accepted and ready to land.Apr 19 2021, 12:00 PM
madhur13490 added inline comments.Apr 19 2021, 12:04 PM
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
42–44

specifically denote typical sequence of instructions generated by frontend

This revision was landed with ongoing or failed builds.Apr 19 2021, 12:05 PM
This revision was automatically updated to reflect the committed changes.
arsenm added inline comments.Apr 19 2021, 12:41 PM
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
42–44

What the frontend initially emits is less important unless we for some reason would break it. This should use the minimum IR to exercise the feature

madhur13490 added inline comments.Apr 20 2021, 12:13 AM
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
42–44

But we have many tests which covers minimum IR. We don't have any which covers typical pattern generated by frontend.

arsenm added inline comments.Apr 22 2021, 6:17 PM
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
42–44

But this isn't what you are testing. The IR should be the minimum set required to reproduce the issue you are attempting to fix