This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix illegal agpr use by VALU
ClosedPublic

Authored by rampitec on Oct 2 2019, 3:07 PM.

Details

Summary

When SIFixSGPRCopies attempts to fix an illegal copy from vector to
scalar register it calls moveToVALU(). A copy from an agpr to sgpr
becomes a copy from agpr to agpr, which may result in the illegal
register class at a use of this copy.

Solution is to copy it always into a vgpr. This may result in a
subsequent copy into an agpr if that is what really needed, however
should not happen too often and likely will be folded later.

The opposite situation may not happen because an sgpr is always
illegal where agpr is legal, so such user instructions may not
exist.

Diff Detail

Event Timeline

rampitec created this revision.Oct 2 2019, 3:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 3:07 PM
arsenm accepted this revision.Oct 2 2019, 4:02 PM

LGTM

This revision is now accepted and ready to land.Oct 2 2019, 4:02 PM
This revision was automatically updated to reflect the committed changes.