-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AMDGPU] Reland "Remove leftover implicit operands from SI_SPILL/SI_RESTORE" #169449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
51695f1
c648db5
4e86066
91a4367
682267d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2094,11 +2094,21 @@ bool SIInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { | |
| break; | ||
|
|
||
| case AMDGPU::SI_SPILL_S32_TO_VGPR: | ||
| MI.setDesc(get(AMDGPU::V_WRITELANE_B32)); | ||
| mutateAndCleanupImplicit(MI, get(AMDGPU::V_WRITELANE_B32)); | ||
| // When leftover implicit-def operands are removed, kill flag is no longer | ||
| // valid. Thus: | ||
| // $X = SI_SPILL_S32_TO_VGPR killed $sgpr0, 0, $X(tied-def 0), | ||
| // implicit-def $sgpr0_sgpr1, implicit $sgpr0_sgpr1 | ||
| // must be converted to: | ||
| // $X = V_WRITELANE_B32 $sgpr0, 0, $X(tied-def 0) | ||
| MI.getOperand(1).setIsKill(false); | ||
| // Sometimes a SGPR that has already been killed is spilled. | ||
| // Add undef to appease the MachineVerifier. | ||
| MI.getOperand(1).setIsUndef(true); | ||
|
Comment on lines
+2105
to
+2107
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part does not. Can you add mir test function for these cases
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested in spilled-kill.mir. |
||
| break; | ||
|
|
||
| case AMDGPU::SI_RESTORE_S32_FROM_VGPR: | ||
| MI.setDesc(get(AMDGPU::V_READLANE_B32)); | ||
| mutateAndCleanupImplicit(MI, get(AMDGPU::V_READLANE_B32)); | ||
| break; | ||
| case AMDGPU::AV_MOV_B32_IMM_PSEUDO: { | ||
| Register Dst = MI.getOperand(0).getReg(); | ||
|
|
||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part seems plausible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in invalid-kill.mir.