This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Enable SGPR copy folding
ClosedPublic

Authored by rampitec on Oct 25 2019, 12:49 PM.

Details

Summary

That used to fail in the lasti testcase function because after
%0:sreg_64.sub0 was folded into %3:sreg_32_xm0_xexec COPY, it
was further folded into S_STORE_DWORD_IMM. Its legal effective
subreg class is SReg_32 while instruction expects more restricted
SReg_32_XM0_EXEC. However, SIInstrInfo::isLegalRegOperand()
passed the legality check and it was caught in the verifier.

Borrowed code from the verifier to check for RC legality.

Diff Detail

Event Timeline

rampitec created this revision.Oct 25 2019, 12:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2019, 12:49 PM
arsenm accepted this revision.Oct 25 2019, 1:32 PM

LGTM. Typo "lasti" in commit message

This revision is now accepted and ready to land.Oct 25 2019, 1:32 PM
This revision was automatically updated to reflect the committed changes.