This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Use removeAllRegUnitsForPhysReg()
ClosedPublic

Authored by ruiling on Jan 11 2022, 5:25 AM.

Details

Summary

I met the issue here when working on something else. I don't look
at it further why I met issue here, but looks like
removeAllRegUnitsForPhysReg() is the right way.

Diff Detail

Event Timeline

ruiling created this revision.Jan 11 2022, 5:25 AM
ruiling requested review of this revision.Jan 11 2022, 5:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2022, 5:25 AM
foad added inline comments.Jan 11 2022, 5:31 AM
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1591

Can you use it here too?

ruiling updated this revision to Diff 398931.Jan 11 2022, 6:15 AM

also for SCC.

critson accepted this revision.Jan 16 2022, 6:48 PM

LGTM

This revision is now accepted and ready to land.Jan 16 2022, 6:48 PM
arsenm added inline comments.Jan 17 2022, 10:30 AM
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1591

There's only one regunit so there's no difference

1595

EXEC is reserved, so does the liveness actually exist?

ruiling added inline comments.Jan 23 2022, 11:14 PM
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1595

yes, it is a little bit strange, the EXEC_LO_LO16 live range appears after register coalescer, I have not figured out what happened.

I agree we need to figure out why register coalescer would introduce the liveness for sub-registers of reserved physical register, but I currently don't have enough time to work on that. I think that can be done separately without blocking this change. I would like to apply this change to fix the issue here if no objection. I noticed we already has a bug-report against this issue https://github.com/llvm/llvm-project/issues/54202.

Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2022, 9:39 PM

No objections from me to you submitting this.
I assume the posted bug report would be sufficient as a starting point for someone (perhaps myself) to try and root cause the why liveness is being introduced for phys subregs?

arsenm accepted this revision.Mar 14 2022, 9:37 AM
This revision was automatically updated to reflect the committed changes.