-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[NewPM] Add FunctionToMachineFunctionPassAdaptor
#88711
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
Conversation
// | ||
// Once function changed by a non-trivial pass, we need to do instruction | ||
// selection again. | ||
auto PAC = PA.getChecker<FunctionAnalysisManagerModuleProxy>(); |
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.
const &?
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.
this returns a PreservedAnalysisChecker
, so it's fine as is
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 you add a test using this in llvm/unittests/CodeGen/PassManagerTest.cpp
?
// | ||
// Once function changed by a non-trivial pass, we need to do instruction | ||
// selection again. | ||
auto PAC = PA.getChecker<FunctionAnalysisManagerModuleProxy>(); |
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.
this returns a PreservedAnalysisChecker
, so it's fine as is
// If this proxy isn't marked as preserved, then even if the result remains | ||
// valid, the key itself may no longer be valid, so we clear everything. | ||
// | ||
// Once function changed by a non-trivial pass, we need to do instruction |
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.
is this something that actually happens? I thought once we're done with codegen, we're basically done with the IR as well
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.
This never happened, MachineOutliner
just only create dummy IR functions to get associated machine functions.
b6058e0
to
e404d6d
Compare
// Clear out the analysis manager if we're being destroyed -- it means we | ||
// didn't even see an invalidate call when we got invalidated. | ||
FAM->clear(); | ||
} |
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.
This causes destruction issue when destruct analysis managers.
Add
FunctionToMachineFunctionPassAdaptor
, currently codegen pipeline has the patternmodule->function->machine-function
ifMachineOutlinerPass
is not enabled. This adaptor allowsFreeMachineFunction
to be a function pass, then we don't need to handle function analyses invalidation inMachinePassManager
etc.Stacked on #88610.
Issue: #84397.