-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CFI][stackprobe] Shrink wrapper select safe prologue insertion block when inline stack probing is enabled #81676
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 |
---|---|---|
|
@@ -957,6 +957,15 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) { | |
if (!ArePointsInteresting()) | ||
return Changed; | ||
|
||
const TargetLowering *TLI = MF.getSubtarget().getTargetLowering(); | ||
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. Suggest placing this whole logic in 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 The current approach - in which the test is placed after all the analysis has been done - is relatively simple and safe - we don't have to worry about missing this test in some code paths in 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. If my reading of Anyway, looking a bit more, I now think the proper place to fix this issue is 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.
A block with NZCV live-in wouldn't necessarily be selected for prologue insertion, so |
||
while (TLI->hasInlineStackProbe(MF) && | ||
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.
|
||
TLI->isStackProbeInstrDefinedFlagRegLiveIn(Save)) { | ||
Save = FindIDom<>(*Save, Save->predecessors(), *MDT); | ||
Restore = FindIDom<>(*Restore, Restore->successors(), *MPDT); | ||
if (!ArePointsInteresting()) | ||
return Changed; | ||
} | ||
|
||
LLVM_DEBUG(dbgs() << "Final shrink wrap candidates:\nSave: " | ||
<< printMBBReference(*Save) << ' ' | ||
<< "\nRestore: " << printMBBReference(*Restore) << '\n'); | ||
|
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.
Suggest renaming to something like
stackProbingMayClobberLiveInRegs
.