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.
This commit is contained in:
Mehdi Amini 2020-08-28 20:17:38 +00:00
parent 0e00a95b4f
commit c39c21610d
3 changed files with 7 additions and 7 deletions

View 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); }

View 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);

View 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>();