-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AMDGPU][MachineRegisterInfo] Extend the MRI live-ins check to account for Subreg #126926
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
Closed
vg0204
wants to merge
4
commits into
llvm:main
from
vg0204:vg0204/extend-MRI-liveInCheck-siLowerSgprSpill
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
447eb33
[AMDGPU][MachineRegisterInfo] Extend the MRI live-ins check by including
vg0204 e384137
Modified MRI liviIn check to have unconditional subreg check
vg0204 df4bf0b
updated the pre-commit tests resolved via the extended MRI liveIns ch…
vg0204 7b07a1a
Replaced subreg check with regUnits check in MRI isLiveIn
vg0204 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
What other users of this exist? I'd prefer to see a patch to SILowerSGPRSpills to not use the MRI liveins before we do anything here.
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.
To elaborate, I do not believe MachineRegisterInfo's live in tracking to be generally reliable. GlobalISel doesn't bother adding entries to it for instance. The verifier does not check that it is consistent with the entry block's live in list. Last I looked at it, I thought we could possibly remove the concept entirely.
I think we need to establish a policy on the live in entry : function live ins to see if it makes sense to have liveness tracking. Right now it's only kind of useful in argument lowering for initial codegen
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.
It requires LiveRegUnitSet (set of all live regUnits) concept in MBB, and its propagation to all its live-ins related APIs to achieve it. As current isLiveIn is based on exact match of PhysReg (which would discard the idea of subReg check entirely). Can we proceed with this idea!
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.
Can it be achieved using
LiveRegUnit
??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.
I don't follow. We don't need any liveness tracking to check if a physical register is live into the function. Why can't you just
s/MRI.isLiveIn(Reg)/MF.begin()->isLiveIn(Reg)/
?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.
Because as the current MBB's isLiveIn defined it won't work as expected to get rid of the issue
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.
Kindly look into #129847 and #129848, with implementation changes needed to utilize MBB's isLiveIn function!