-
Notifications
You must be signed in to change notification settings - Fork 13.6k
CodeGen/NewPM: Initialize MMI in NewPM path #99754
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
This should have been in c2019a3, but it breaks with: Assertion failed: (AnalysisPasses.count(PassT::ID()) && "This analysis pass was not registered prior to being queried"), function getResult, file PassManager.h, line 407.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-llvm-selectiondag Author: Matt Arsenault (arsenm) ChangesThis should have been in c2019a3, Assertion failed: (AnalysisPasses.count(PassT::ID()) && "This analysis pass was not registered prior to being queried"), function getResult, file PassManager.h, line 407. Full diff: https://github.com/llvm/llvm-project/pull/99754.diff 2 Files Affected:
diff --git a/llvm/include/llvm/Passes/MachinePassRegistry.def b/llvm/include/llvm/Passes/MachinePassRegistry.def
index 03f0782de6fed..e702721c299a8 100644
--- a/llvm/include/llvm/Passes/MachinePassRegistry.def
+++ b/llvm/include/llvm/Passes/MachinePassRegistry.def
@@ -17,6 +17,7 @@
#define MODULE_ANALYSIS(NAME, CREATE_PASS)
#endif
MODULE_ANALYSIS("collector-metadata", CollectorMetadataAnalysis())
+MODULE_ANALYSIS("machine-module-info", MachineModuleAnalysis())
MODULE_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC))
#undef MODULE_ANALYSIS
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 2670ff488fbed..478e544fd4bc0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -509,6 +509,8 @@ void SelectionDAGISel::initializeAnalysisResults(
FnVarLocs = &FAM.getResult<DebugAssignmentTrackingAnalysis>(Fn);
auto *UA = FAM.getCachedResult<UniformityInfoAnalysis>(Fn);
+ MMI = &MFAM.getResult<MachineModuleAnalysis>(*MF).getMMI();
+
CurDAG->init(*MF, *ORE, MFAM, LibInfo, UA, PSI, BFI, *MMI, FnVarLocs);
// Now get the optional analyzes if we want to.
|
@@ -509,6 +509,8 @@ void SelectionDAGISel::initializeAnalysisResults( | |||
FnVarLocs = &FAM.getResult<DebugAssignmentTrackingAnalysis>(Fn); | |||
|
|||
auto *UA = FAM.getCachedResult<UniformityInfoAnalysis>(Fn); | |||
MMI = &MFAM.getResult<MachineModuleAnalysis>(*MF).getMMI(); |
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.
IIUC it should be obtained from ModuleAnalysisManager
or ModuleAnalysisManagerMachineFunctionProxy
, but current ModuleAnalysisManagerMachineFunctionProxy
is an OuterAnalysisManagerProxy
.
off-topic: Ideally, it should be thread-safe to obtain module analysis results in machine function pass pipeline.
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 was expecting this to not compile if it wasn't going to work. I'm not sure how to get a ModuleAnalysisManager from the MachineFunctionAnalysisManager
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 think the registration is just not happening and I'm not sure why. I can't run the analysis standalone with -passes either
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.
ping. Is MachineModuleInfo just broken in new PM?
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.
MMI = &MFAM.getResult<MachineModuleAnalysis>(*MF).getMMI(); | |
MMI = MFAM.getResult<ModuleAnalysisManagerMachineFunctionProxy>(*MF) | |
.getCachedResult<MachineModuleAnalysis>(*MF->getFunction().getParent()); |
Thanks, folded into #99779 |
This should have been in c2019a3,
but it breaks with:
Assertion failed: (AnalysisPasses.count(PassT::ID()) && "This analysis pass was not registered prior to being queried"), function getResult, file PassManager.h, line 407.