From: Mehdi Amini Date: Fri, 28 Aug 2020 20:17:38 +0000 (+0000) Subject: Rename AnalysisManager::slice in AnalysisManager::nest (NFC) X-Git-Tag: llvmorg-13-init~13384 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c39c21610d8be55209951531a7d0cc022aa4d8c1;p=platform%2Fupstream%2Fllvm.git 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. --- diff --git a/mlir/include/mlir/Pass/AnalysisManager.h b/mlir/include/mlir/Pass/AnalysisManager.h index 37036e2..0981ce2 100644 --- a/mlir/include/mlir/Pass/AnalysisManager.h +++ b/mlir/include/mlir/Pass/AnalysisManager.h @@ -265,14 +265,14 @@ public: /// Query for an analysis of a child operation, constructing it if necessary. template AnalysisT &getChildAnalysis(Operation *op) { - return slice(op).template getAnalysis(); + return nest(op).template getAnalysis(); } /// Query for an analysis of a child operation of a specifc derived operation /// type, constructing it if necessary. template AnalysisT &getChildAnalysis(OpT child) { - return slice(child).template getAnalysis(); + return nest(child).template getAnalysis(); } /// Query for a cached analysis of a child operation, or return null. @@ -287,7 +287,7 @@ public: } /// 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 4a423bf..bb52163 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 different parent operation"); auto it = impl->childAnalyses.find(op); diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp index 918c898..7cefd68 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 different analyses, but only preserve one before invalidating. fam.getAnalysis();