[AMDGPU] VGPR instruction placement should be aware of exec mask prol…#175080
Closed
carlobertolli wants to merge 1 commit intollvm:mainfrom
Closed
[AMDGPU] VGPR instruction placement should be aware of exec mask prol…#175080carlobertolli wants to merge 1 commit intollvm:mainfrom
carlobertolli wants to merge 1 commit intollvm:mainfrom
Conversation
…ogues. This patch changes the insertion logic for VGPR modifying instruction to skip to after the exec mask is reset, if such an instruction is present in the basic block. It is used to prevent placement of scratch store/load for VGPRs before the exec mask is reset on AMDGPUs.
cdevadas
reviewed
Jan 9, 2026
Collaborator
cdevadas
left a comment
There was a problem hiding this comment.
Introducing another target hook while retaining isBasicBlockPrologue would increase the complexity further. This approach doesn't seem like a favorable one for addressing our problem.
| /// a basic block. This is used by the register allocator's live range | ||
| /// splitting logic. | ||
| virtual MachineBasicBlock::iterator | ||
| getExecAwareInsertPoint(MachineBasicBlock &MBB, Register Reg) const; |
Collaborator
There was a problem hiding this comment.
Should use a generic name without any target-dependent register details in a common file.
Member
Author
|
Alternative approach is now approved: https://github.com/llvm/llvm-project/pull/117544 closing this draft PR. |
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
Sign up for free
to 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.
…ogues.
This patch changes the insertion logic for VGPR modifying instruction to skip to after the exec mask is reset, if such an instruction is present in the basic block. It is used to prevent placement of scratch store/load for VGPRs before the exec mask is reset on AMDGPUs.