- Notifications
You must be signed in to change notification settings - Fork14.5k
AMDGPU: Handle av imm pseudo in si-fix-sgpr-copies phi fold#149263
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
arsenm merged 1 commit intomainfromusers/arsenm/amdgpu/handle-av-imm-pseudo-fix-sgpr-copies-phi-foldJul 18, 2025
Merged
AMDGPU: Handle av imm pseudo in si-fix-sgpr-copies phi fold#149263
arsenm merged 1 commit intomainfromusers/arsenm/amdgpu/handle-av-imm-pseudo-fix-sgpr-copies-phi-foldJul 18, 2025
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesFull diff:https://github.com/llvm/llvm-project/pull/149263.diff 2 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp b/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cppindex 9b5a46395695d..44d9ef5a0792e 100644--- a/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp+++ b/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp@@ -378,6 +378,7 @@ static bool isSafeToFoldImmIntoCopy(const MachineInstr *Copy, default: return false; case AMDGPU::V_MOV_B32_e32:+ case AMDGPU::AV_MOV_B32_IMM_PSEUDO: SMovOp = AMDGPU::S_MOV_B32; break; case AMDGPU::V_MOV_B64_PSEUDO:diff --git a/llvm/test/CodeGen/AMDGPU/phi-vgpr-input-moveimm.mir b/llvm/test/CodeGen/AMDGPU/phi-vgpr-input-moveimm.mirindex c2c5340639a16..8145a1d7a2072 100644--- a/llvm/test/CodeGen/AMDGPU/phi-vgpr-input-moveimm.mir+++ b/llvm/test/CodeGen/AMDGPU/phi-vgpr-input-moveimm.mir@@ -167,3 +167,59 @@ body: | %1:sreg_32 = COPY %0 S_BRANCH %bb.2 ...++---++name: phi_moveimm_av_pseudo_input+tracksRegLiveness: true+body: |+ ; GCN-LABEL: name: phi_moveimm_av_pseudo_input+ ; GCN: bb.0:+ ; GCN-NEXT: successors: %bb.1(0x80000000)+ ; GCN-NEXT: liveins: $sgpr0, $sgpr1+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: [[AV_MOV_:%[0-9]+]]:vgpr_32 = AV_MOV_B32_IMM_PSEUDO 0, implicit $exec+ ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0+ ; GCN-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: bb.1:+ ; GCN-NEXT: successors: %bb.2(0x80000000)+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: [[S_ADD_U32_:%[0-9]+]]:sreg_32 = S_ADD_U32 [[COPY]], [[COPY1]], implicit-def $scc+ ; GCN-NEXT: S_BRANCH %bb.2+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: bb.2:+ ; GCN-NEXT: successors: %bb.3(0x80000000)+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: [[PHI:%[0-9]+]]:sreg_32 = PHI %5, %bb.3, [[S_ADD_U32_]], %bb.1+ ; GCN-NEXT: S_BRANCH %bb.3+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: bb.3:+ ; GCN-NEXT: successors: %bb.2(0x80000000)+ ; GCN-NEXT: {{ $}}+ ; GCN-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0+ ; GCN-NEXT: S_BRANCH %bb.2+ bb.0:+ successors: %bb.1+ liveins: $sgpr0, $sgpr1++ %0:vgpr_32 = AV_MOV_B32_IMM_PSEUDO 0, implicit $exec++ %4:sreg_32 = COPY $sgpr0+ %5:sreg_32 = COPY $sgpr1++ bb.1:+ successors: %bb.2+ %2:sreg_32 = S_ADD_U32 %4, %5, implicit-def $scc+ S_BRANCH %bb.2++ bb.2:+ successors: %bb.3+ %3:sreg_32 = PHI %1, %bb.3, %2, %bb.1+ S_BRANCH %bb.3++ bb.3:+ successors: %bb.2+ %1:sreg_32 = COPY %0+ S_BRANCH %bb.2+... |
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.
LGTM
a131ce9
intomain 13 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.