This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix allowing immediates for tail call pseudo.
ClosedPublic

Authored by arsenm on Mar 15 2021, 6:00 AM.

Details

Reviewers
rampitec
dp
Summary

The pseudo was using SSrc_b64, so it allowed folding immediates into
the destination operand for a tail call to null. However, this is not
a valid operand for the s_setpc_b64 this will be lowered to. Avoids
printing the operand as an invalid immediate.

Avoids a regression when tail calls are enabled in GlobalISel (somehow
tail calls to null get deleted in the DAG).

Diff Detail

Event Timeline

arsenm created this revision.Mar 15 2021, 6:00 AM
arsenm requested review of this revision.Mar 15 2021, 6:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2021, 6:00 AM
Herald added a subscriber: wdng. · View Herald Transcript
dp added a comment.Mar 15 2021, 7:21 AM

I don't see any restriction noted that this must be a register, so just allow any SSrc_b64 like normal.

Documentation is not clear here, however sp3 does not allow constants for src0 (as opposed to null).

rampitec requested changes to this revision.Mar 15 2021, 10:04 AM
In D98631#2626123, @dp wrote:

I don't see any restriction noted that this must be a register, so just allow any SSrc_b64 like normal.

Documentation is not clear here, however sp3 does not allow constants for src0 (as opposed to null).

+1. It is defined as OPR_SREG.

This revision now requires changes to proceed.Mar 15 2021, 10:04 AM
arsenm updated this revision to Diff 331568.Mar 18 2021, 8:11 AM
arsenm retitled this revision from AMDGPU: Don't require registers for s_setpc_b64 operand to AMDGPU: Fix allowing immediates for tail call pseudo..
arsenm edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 18 2021, 9:08 AM