-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RegScavenger] Simplify state tracking for backwards scavenging #71202
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 |
---|---|---|
|
@@ -299,7 +299,7 @@ bool AArch64SpeculationHardening::instrumentControlFlow( | |
if (I == MBB.begin()) | ||
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. The |
||
RS.enterBasicBlock(MBB); | ||
else | ||
RS.backward(std::prev(I)); | ||
RS.backward(I); | ||
// FIXME: The below just finds *a* unused register. Maybe code could be | ||
// optimized more if this looks for the register that isn't used for the | ||
// longest time around this place, to enable more scheduling freedom. Not | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,7 +466,7 @@ PPCFrameLowering::findScratchRegister(MachineBasicBlock *MBB, | |
RS.enterBasicBlock(*MBB); | ||
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. Same here, the |
||
} else { | ||
RS.enterBasicBlockEnd(*MBB); | ||
RS.backward(std::prev(MBBI)); | ||
RS.backward(MBBI); | ||
} | ||
} else { | ||
// The scratch register will be used at the start of the block. | ||
|
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.
Nice cleanup here.
LocalRS->MBBI
now points afterMI
, to an instruction which will not have been affected by the call toTRI.eliminateFrameIndex
, so there is no need to refresh anything.