-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CodeGen][PM] Initialize analyses with isAnalysis=true #118779
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
[CodeGen][PM] Initialize analyses with isAnalysis=true #118779
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
949e14d
to
7e6d9ff
Compare
d9e5fac
to
13da564
Compare
@llvm/pr-subscribers-llvm-regalloc @llvm/pr-subscribers-debuginfo Author: Akshat Oke (optimisan) ChangesAnalyses should be marked as analyses. Otherwise they are prone to get ignored by the legacy analysis cache mechanism and get scheduled redundantly. Full diff: https://github.com/llvm/llvm-project/pull/118779.diff 8 Files Affected:
diff --git a/llvm/lib/CodeGen/GCMetadata.cpp b/llvm/lib/CodeGen/GCMetadata.cpp
index 6d1cc1a58e27df..f33008c9e0f232 100644
--- a/llvm/lib/CodeGen/GCMetadata.cpp
+++ b/llvm/lib/CodeGen/GCMetadata.cpp
@@ -66,7 +66,7 @@ GCFunctionAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
}
INITIALIZE_PASS(GCModuleInfo, "collector-metadata",
- "Create Garbage Collector Module Metadata", false, false)
+ "Create Garbage Collector Module Metadata", false, true)
// -----------------------------------------------------------------------------
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 317d3401f000a4..79085e587ebc45 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -82,7 +82,7 @@ INITIALIZE_PASS_BEGIN(LiveDebugVariablesWrapperLegacy, DEBUG_TYPE,
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_END(LiveDebugVariablesWrapperLegacy, DEBUG_TYPE,
- "Debug Variable Analysis", false, false)
+ "Debug Variable Analysis", false, true)
void LiveDebugVariablesWrapperLegacy::getAnalysisUsage(
AnalysisUsage &AU) const {
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index f9ee6e4563f8d6..f38527a3ce6a31 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -83,7 +83,7 @@ INITIALIZE_PASS_BEGIN(LiveIntervalsWrapperPass, "liveintervals",
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_END(LiveIntervalsWrapperPass, "liveintervals",
- "Live Interval Analysis", false, false)
+ "Live Interval Analysis", false, true)
bool LiveIntervalsWrapperPass::runOnMachineFunction(MachineFunction &MF) {
LIS.Indexes = &getAnalysis<SlotIndexesWrapperPass>().getSI();
diff --git a/llvm/lib/CodeGen/LiveRegMatrix.cpp b/llvm/lib/CodeGen/LiveRegMatrix.cpp
index bc8c59381a40e1..9744c47d5a8510 100644
--- a/llvm/lib/CodeGen/LiveRegMatrix.cpp
+++ b/llvm/lib/CodeGen/LiveRegMatrix.cpp
@@ -41,7 +41,7 @@ INITIALIZE_PASS_BEGIN(LiveRegMatrixWrapperLegacy, "liveregmatrix",
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(VirtRegMapWrapperLegacy)
INITIALIZE_PASS_END(LiveRegMatrixWrapperLegacy, "liveregmatrix",
- "Live Register Matrix", false, false)
+ "Live Register Matrix", false, true)
void LiveRegMatrixWrapperLegacy::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
diff --git a/llvm/lib/CodeGen/LiveStacks.cpp b/llvm/lib/CodeGen/LiveStacks.cpp
index 49fe5d6b23452e..e5d2b90578d829 100644
--- a/llvm/lib/CodeGen/LiveStacks.cpp
+++ b/llvm/lib/CodeGen/LiveStacks.cpp
@@ -24,7 +24,7 @@ INITIALIZE_PASS_BEGIN(LiveStacksWrapperLegacy, DEBUG_TYPE,
"Live Stack Slot Analysis", false, false)
INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_END(LiveStacksWrapperLegacy, DEBUG_TYPE,
- "Live Stack Slot Analysis", false, false)
+ "Live Stack Slot Analysis", false, true)
char &llvm::LiveStacksID = LiveStacksWrapperLegacy::ID;
diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp
index 1b92a5aa59d18c..8d2832b3fdd56e 100644
--- a/llvm/lib/CodeGen/SlotIndexes.cpp
+++ b/llvm/lib/CodeGen/SlotIndexes.cpp
@@ -45,7 +45,7 @@ SlotIndexes::~SlotIndexes() {
}
INITIALIZE_PASS(SlotIndexesWrapperPass, DEBUG_TYPE, "Slot index numbering",
- false, false)
+ false, true)
STATISTIC(NumLocalRenum, "Number of local renumberings");
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index 1352102a93d01b..b28c74600e7a29 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -60,7 +60,7 @@ STATISTIC(NumIdCopies, "Number of identity moves eliminated after rewriting");
char VirtRegMapWrapperLegacy::ID = 0;
INITIALIZE_PASS(VirtRegMapWrapperLegacy, "virtregmap", "Virtual Register Map",
- false, false)
+ false, true)
void VirtRegMap::init(MachineFunction &mf) {
MRI = &mf.getRegInfo();
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index 44fdfe530178a9..d8298646e18d7e 100644
--- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
@@ -777,8 +777,8 @@ INITIALIZE_PASS_BEGIN(LoopSimplify, "loop-simplify",
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
-INITIALIZE_PASS_END(LoopSimplify, "loop-simplify",
- "Canonicalize natural loops", false, false)
+INITIALIZE_PASS_END(LoopSimplify, "loop-simplify", "Canonicalize natural loops",
+ false, true)
// Publicly exposed interface to pass...
char &llvm::LoopSimplifyID = LoopSimplify::ID;
|
13da564
to
7ee8621
Compare
4493f30
to
765ac4b
Compare
eeca6f9
to
1efd223
Compare
Merge activity
|
765ac4b
to
3da7b77
Compare
41aff66
to
6cf8e8d
Compare
Analyses should be marked as analyses else they are prone to be ignored by the legacy analysis cache mechanism and get scheduled redundantly.
6cf8e8d
to
df18a2e
Compare
@@ -777,8 +777,8 @@ INITIALIZE_PASS_BEGIN(LoopSimplify, "loop-simplify", | |||
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker) | |||
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) | |||
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass) | |||
INITIALIZE_PASS_END(LoopSimplify, "loop-simplify", |
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 loop-simplify is a transformation pass, not an analysis?
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.
Oh yes it's not an analysis. I had naively logged a list of passes being addRequired
that weren't marked as analyses.
Reverting this line.
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.
Fixed in #121433
This reverts part of the changes in #118779
Analyses should be marked as analyses.
Otherwise they are prone to get ignored by the legacy analysis cache mechanism and get scheduled redundantly.