[Mlir-commits] [mlir] c39c216 - Rename AnalysisManager::slice in AnalysisManager::nest (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Fri Aug 28 13:41:22 PDT 2020
Author: Mehdi Amini
Date: 2020-08-28T20:41:07Z
New Revision: c39c21610d8be55209951531a7d0cc022aa4d8c1
URL: https://github.com/llvm/llvm-project/commit/c39c21610d8be55209951531a7d0cc022aa4d8c1
DIFF: https://github.com/llvm/llvm-project/commit/c39c21610d8be55209951531a7d0cc022aa4d8c1.diff
LOG: Rename AnalysisManager::slice in AnalysisManager::nest (NFC)
The naming wasn't reflecting the intent of this API, "nest" is aligning
it with the pass manager API.
Added:
Modified:
mlir/include/mlir/Pass/AnalysisManager.h
mlir/lib/Pass/Pass.cpp
mlir/unittests/Pass/AnalysisManagerTest.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Pass/AnalysisManager.h b/mlir/include/mlir/Pass/AnalysisManager.h
index 37036e2298d0..0981ce2d0210 100644
--- a/mlir/include/mlir/Pass/AnalysisManager.h
+++ b/mlir/include/mlir/Pass/AnalysisManager.h
@@ -265,14 +265,14 @@ class AnalysisManager {
/// Query for an analysis of a child operation, constructing it if necessary.
template <typename AnalysisT> AnalysisT &getChildAnalysis(Operation *op) {
- return slice(op).template getAnalysis<AnalysisT>();
+ return nest(op).template getAnalysis<AnalysisT>();
}
/// Query for an analysis of a child operation of a specifc derived operation
/// type, constructing it if necessary.
template <typename AnalysisT, typename OpT>
AnalysisT &getChildAnalysis(OpT child) {
- return slice(child).template getAnalysis<AnalysisT, OpT>();
+ return nest(child).template getAnalysis<AnalysisT, OpT>();
}
/// Query for a cached analysis of a child operation, or return null.
@@ -287,7 +287,7 @@ class AnalysisManager {
}
/// Get an analysis manager for the given child operation.
- AnalysisManager slice(Operation *op);
+ AnalysisManager nest(Operation *op);
/// Invalidate any non preserved analyses,
void invalidate(const PreservedAnalyses &pa) { impl->invalidate(pa); }
diff --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp
index 4a423bf7f1ab..bb521633b5f3 100644
--- a/mlir/lib/Pass/Pass.cpp
+++ b/mlir/lib/Pass/Pass.cpp
@@ -457,7 +457,7 @@ void OpToOpPassAdaptor::runOnOperationImpl() {
// Run the held pipeline over the current operation.
if (instrumentor)
instrumentor->runBeforePipeline(mgr->getOpName(), parentInfo);
- auto result = runPipeline(mgr->getPasses(), &op, am.slice(&op));
+ auto result = runPipeline(mgr->getPasses(), &op, am.nest(&op));
if (instrumentor)
instrumentor->runAfterPipeline(mgr->getOpName(), parentInfo);
@@ -496,7 +496,7 @@ void OpToOpPassAdaptor::runOnOperationAsyncImpl() {
for (auto &op : block) {
// Add this operation iff the name matches the any of the pass managers.
if (findPassManagerFor(mgrs, op.getName()))
- opAMPairs.emplace_back(&op, am.slice(&op));
+ opAMPairs.emplace_back(&op, am.nest(&op));
}
}
}
@@ -803,7 +803,7 @@ PassInstrumentor *AnalysisManager::getPassInstrumentor() const {
}
/// Get an analysis manager for the given child operation.
-AnalysisManager AnalysisManager::slice(Operation *op) {
+AnalysisManager AnalysisManager::nest(Operation *op) {
assert(op->getParentOp() == impl->getOperation() &&
"'op' has a
diff erent parent operation");
auto it = impl->childAnalyses.find(op);
diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp
index 918c8985eb0c..7cefd6870eeb 100644
--- a/mlir/unittests/Pass/AnalysisManagerTest.cpp
+++ b/mlir/unittests/Pass/AnalysisManagerTest.cpp
@@ -63,7 +63,7 @@ TEST(AnalysisManagerTest, FineGrainFunctionAnalysisPreservation) {
// Test fine grain invalidation of the function analysis manager.
ModuleAnalysisManager mam(*module, /*passInstrumentor=*/nullptr);
AnalysisManager am = mam;
- AnalysisManager fam = am.slice(func1);
+ AnalysisManager fam = am.nest(func1);
// Query two
diff erent analyses, but only preserve one before invalidating.
fam.getAnalysis<MyAnalysis>();
More information about the Mlir-commits
mailing list