Rename AnalysisManager::slice in AnalysisManager::nest (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Fri, 28 Aug 2020 20:17:38 +0000 (20:17 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 28 Aug 2020 20:41:07 +0000 (20:41 +0000)
The naming wasn't reflecting the intent of this API, "nest" is aligning
it with the pass manager API.

mlir/include/mlir/Pass/AnalysisManager.h
mlir/lib/Pass/Pass.cpp
mlir/unittests/Pass/AnalysisManagerTest.cpp

index 37036e2..0981ce2 100644 (file)
@@ -265,14 +265,14 @@ public:
 
   /// 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 @@ 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); }
index 4a423bf..bb52163 100644 (file)
@@ -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);
index 918c898..7cefd68 100644 (file)
@@ -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<MyAnalysis>();