-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU] Fix machine verification failure from INIT_EXEC lowering #98333
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
Changes from all commits
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 |
---|---|---|
|
@@ -1676,6 +1676,8 @@ bool SIWholeQuadMode::runOnMachineFunction(MachineFunction &MF) { | |
if (!(GlobalFlags & (StateWQM | StateStrict)) && LowerToCopyInstrs.empty() && | ||
LowerToMovInstrs.empty() && KillInstrs.empty()) { | ||
lowerLiveMaskQueries(); | ||
if (!InitExecInstrs.empty()) | ||
LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC); | ||
return !InitExecInstrs.empty() || !LiveMaskQueries.empty(); | ||
} | ||
|
||
|
@@ -1717,7 +1719,7 @@ bool SIWholeQuadMode::runOnMachineFunction(MachineFunction &MF) { | |
LIS->removeAllRegUnitsForPhysReg(AMDGPU::SCC); | ||
|
||
// If we performed any kills then recompute EXEC | ||
if (!KillInstrs.empty()) | ||
if (!KillInstrs.empty() || !InitExecInstrs.empty()) | ||
LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC); | ||
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 shouldn't be necessary in the first place. Reserved registers, like exec, do not have liveness tracked 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. Well I see stuff like this in the dumps:
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. Those shouldn't have been created in the first place. Where did they come from? 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. In this test case they are formed in Register Coalescer when it attempts to merge a copy of EXEC with a virtual and asks for an interval on a EXEC reg unit. Reserved registers still have intervals, they are a sequence of a dead defs, one for each assignment to the register. |
||
|
||
return true; | ||
|
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 am now even more convinced that we should not bother with this fast path. We should just make sure that the general path is fast when there is no work to do.
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'll run compile time testing on a version without it -- it's possible there really is little difference already.
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.
The only thing I can see that we might be able to skip over in some cases is the two
for (auto BII : Blocks)
loops below.