This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Propagate AGPR RC from PHI to its PHI operands
ClosedPublic

Authored by rampitec on Apr 2 2020, 4:12 PM.

Details

Summary

We can fix register class of PHI based on its all AGPR uses.
That leaves behind all PHIs which were already processed
earlier. Propagate RC back to PHI operands of a PHI.

Diff Detail

Event Timeline

rampitec created this revision.Apr 2 2020, 4:12 PM
arsenm added inline comments.Apr 2 2020, 4:27 PM
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
854

s/themself/themselves

llvm/test/CodeGen/AMDGPU/mfma-loop.ll
534

Should also have a test where a phi directly refers to itself

rampitec marked an inline comment as done.Apr 2 2020, 4:55 PM
rampitec added inline comments.
llvm/test/CodeGen/AMDGPU/mfma-loop.ll
534

Is it a real case?! This is SSA, value should be defined earlier.

rampitec updated this revision to Diff 254648.Apr 2 2020, 5:01 PM
rampitec marked an inline comment as done.

Fixed comment.

rtaylor accepted this revision.Apr 2 2020, 5:24 PM

LGTM

This revision is now accepted and ready to land.Apr 2 2020, 5:24 PM
rampitec marked an inline comment as done.Apr 3 2020, 11:06 AM
rampitec added inline comments.
llvm/test/CodeGen/AMDGPU/mfma-loop.ll
534

I cannot create a relevant test. If PHI refers itself it does not refer an MFMA inside the loop which is needed to start propagation. I.e. such PHI never triggers this code.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2020, 11:54 AM