This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Correctly set IsKill flag for VGPR spills in the prolog
ClosedPublic

Authored by cdevadas on Apr 21 2022, 12:16 PM.

Details

Summary

We always assume the vector register is dead or killed while
inserting the VGPR spills in the prolog. It is not always
true. Used the entry block liveIn data while setting the flag.

Diff Detail

Repository
rG LLVM Github Monorepo
Build Status
Buildable 188381

Event Timeline

cdevadas created this revision.Apr 21 2022, 12:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 12:16 PM
cdevadas requested review of this revision.Apr 21 2022, 12:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 12:16 PM
foad added inline comments.Apr 22 2022, 3:02 AM
llvm/test/CodeGen/AMDGPU/track-spilled-vgpr-liveness.mir
2

Can you precommit this test so we can see the diff?

cdevadas added inline comments.Apr 25 2022, 4:17 AM
llvm/test/CodeGen/AMDGPU/track-spilled-vgpr-liveness.mir
2

Prior to this patch, the test would end up with a verifier error complaining undefined register used.
It is because we unconditionally mark 'killed' for the register in the prolog spill and the use following that will be flagged by the verifier.

arsenm accepted this revision.Apr 25 2022, 1:57 PM
This revision is now accepted and ready to land.Apr 25 2022, 1:57 PM
cdevadas updated this revision to Diff 462451.Sep 23 2022, 5:26 AM

Remove the spilled register from LiveRegs only when IsKill is true.

arsenm accepted this revision.Sep 23 2022, 5:52 AM
cdevadas updated this revision to Diff 472274.Nov 1 2022, 6:35 AM
cdevadas retitled this revision from [AMDGPU] Correctly set `IsKill` flag for VGPR custom spills in the prolog to [AMDGPU] Correctly set IsKill flag for VGPR spills in the prolog.
cdevadas edited the summary of this revision. (Show Details)

Fixed the title and summary to avoid the use of "custom" while refering PrologEpilog spills.

arsenm accepted this revision.Nov 1 2022, 10:16 AM
cdevadas updated this revision to Diff 482882.Dec 14 2022, 9:01 AM

code rebase

arsenm accepted this revision.Dec 14 2022, 9:03 AM
This revision was landed with ongoing or failed builds.Dec 16 2022, 10:19 PM
This revision was automatically updated to reflect the committed changes.