-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[NewPM] LiveIntervals: Check dependencies for invalidation #123563
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 1 commit
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 |
---|---|---|
|
@@ -127,6 +127,20 @@ LiveIntervalsWrapperPass::LiveIntervalsWrapperPass() : MachineFunctionPass(ID) { | |
|
||
LiveIntervals::~LiveIntervals() { clear(); } | ||
|
||
bool LiveIntervals::invalidate( | ||
MachineFunction &MF, const PreservedAnalyses &PA, | ||
MachineFunctionAnalysisManager::Invalidator &Inv) { | ||
auto PAC = PA.getChecker<LiveIntervalsAnalysis>(); | ||
|
||
if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<MachineFunction>>()) | ||
return true; | ||
|
||
// LiveIntervals holds pointers to these results, so check for their | ||
// invalidation. | ||
return (Inv.invalidate<SlotIndexesAnalysis>(MF, PA) || | ||
Inv.invalidate<MachineDominatorTreeAnalysis>(MF, PA)); | ||
} | ||
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. IIUC when control flow reaches here, it implies live intervals or all machine function analyses are preserved. It invalidates them forcibly. Move them to SlotIndexesAnalysis? 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.
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. Then PreservedAnalyses SomePass::run(IRUnitT &, AnalysisManager &) {
PreservedAnalyses PA;
PA.preserve<LiveIntervals>();
return PA;
} will no longer work, which is counter-intuitive... because it doesn't preserve 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. Yes, it is related here #123045 (comment) New PM can't report such cases. Could add such a functionality behind a flag but I guess it's unlikely for more cases like this to exist, since they would lead to invalid reads (as the PM deletes the results). 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 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.
I don't think it's easily trackable which analyses depend on other analyses without a bunch of extra infrastructure, so unless this is a problem that comes up a lot I'm inclined to say it's not worth the effort |
||
|
||
void LiveIntervals::clear() { | ||
// Free the live intervals themselves. | ||
for (unsigned i = 0, e = VirtRegIntervals.size(); i != e; ++i) | ||
|
Uh oh!
There was an error while loading. Please reload this page.