1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Consistently use FunctionAnalysisManager

Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.

Thanks to David for the suggestion.

llvm-svn: 278077
This commit is contained in:
Sean Silva 2016-08-09 00:28:15 +00:00
parent c572809ebb
commit 11e71061b1
83 changed files with 108 additions and 108 deletions

View File

@ -878,7 +878,7 @@ public:
ResultGetters.push_back(&getModuleAAResultImpl<AnalysisT>);
}
Result run(Function &F, AnalysisManager<Function> &AM) {
Result run(Function &F, FunctionAnalysisManager &AM) {
Result R(AM.getResult<TargetLibraryAnalysis>(F));
for (auto &Getter : ResultGetters)
(*Getter)(F, AM, R);
@ -889,19 +889,19 @@ private:
friend AnalysisInfoMixin<AAManager>;
static char PassID;
SmallVector<void (*)(Function &F, AnalysisManager<Function> &AM,
SmallVector<void (*)(Function &F, FunctionAnalysisManager &AM,
AAResults &AAResults),
4> ResultGetters;
template <typename AnalysisT>
static void getFunctionAAResultImpl(Function &F,
AnalysisManager<Function> &AM,
FunctionAnalysisManager &AM,
AAResults &AAResults) {
AAResults.addAAResult(AM.template getResult<AnalysisT>(F));
}
template <typename AnalysisT>
static void getModuleAAResultImpl(Function &F, AnalysisManager<Function> &AM,
static void getModuleAAResultImpl(Function &F, FunctionAnalysisManager &AM,
AAResults &AAResults) {
auto &MAM =
AM.getResult<ModuleAnalysisManagerFunctionProxy>(F).getManager();

View File

@ -53,7 +53,7 @@ public:
~AAEvaluator();
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
private:
// Allow the legacy pass to run this using an internal API.

View File

@ -117,7 +117,7 @@ class AssumptionPrinterPass : public PassInfoMixin<AssumptionPrinterPass> {
public:
explicit AssumptionPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief An immutable pass that tracks lazily created \c AssumptionCache

View File

@ -198,7 +198,7 @@ class BasicAA : public AnalysisInfoMixin<BasicAA> {
public:
typedef BasicAAResult Result;
BasicAAResult run(Function &F, AnalysisManager<Function> &AM);
BasicAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the BasicAAResult object.

View File

@ -97,7 +97,7 @@ public:
typedef BlockFrequencyInfo Result;
/// \brief Run the analysis pass over a function and produce BFI.
Result run(Function &F, AnalysisManager<Function> &AM);
Result run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for the \c BlockFrequencyInfo results.
@ -107,7 +107,7 @@ class BlockFrequencyPrinterPass
public:
explicit BlockFrequencyPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Legacy analysis pass which computes \c BlockFrequencyInfo.

View File

@ -185,7 +185,7 @@ public:
typedef BranchProbabilityInfo Result;
/// \brief Run the analysis pass over a function and produce BPI.
BranchProbabilityInfo run(Function &F, AnalysisManager<Function> &AM);
BranchProbabilityInfo run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for the \c BranchProbabilityAnalysis results.
@ -195,7 +195,7 @@ class BranchProbabilityPrinterPass
public:
explicit BranchProbabilityPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Legacy analysis pass which computes \c BranchProbabilityInfo.

View File

@ -108,7 +108,7 @@ class CFLAndersAA : public AnalysisInfoMixin<CFLAndersAA> {
public:
typedef CFLAndersAAResult Result;
CFLAndersAAResult run(Function &F, AnalysisManager<Function> &AM);
CFLAndersAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the CFLAndersAAResult object.

View File

@ -127,7 +127,7 @@ class CFLSteensAA : public AnalysisInfoMixin<CFLSteensAA> {
public:
typedef CFLSteensAAResult Result;
CFLSteensAAResult run(Function &F, AnalysisManager<Function> &AM);
CFLSteensAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the CFLSteensAAResult object.

View File

@ -97,7 +97,7 @@ public:
/// \brief Run the analysis pass over a function and produce demanded bits
/// information.
DemandedBits run(Function &F, AnalysisManager<Function> &AM);
DemandedBits run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for DemandedBits
@ -106,7 +106,7 @@ class DemandedBitsPrinterPass : public PassInfoMixin<DemandedBitsPrinterPass> {
public:
explicit DemandedBitsPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// Create a demanded bits analysis pass.

View File

@ -178,7 +178,7 @@ public:
typedef DominanceFrontier Result;
/// \brief Run the analysis pass over a function and produce a dominator tree.
DominanceFrontier run(Function &F, AnalysisManager<Function> &AM);
DominanceFrontier run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for the \c DominanceFrontier.
@ -188,7 +188,7 @@ class DominanceFrontierPrinterPass
public:
explicit DominanceFrontierPrinterPass(raw_ostream &OS);
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
} // End llvm namespace

View File

@ -794,7 +794,7 @@ class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
public:
typedef LoopInfo Result;
LoopInfo run(Function &F, AnalysisManager<Function> &AM);
LoopInfo run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for the \c LoopAnalysis results.
@ -803,12 +803,12 @@ class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
public:
explicit LoopPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Verifier pass for the \c LoopAnalysis results.
struct LoopVerifierPass : public PassInfoMixin<LoopVerifierPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief The legacy pass manager's analysis pass to compute loop information.

View File

@ -479,7 +479,7 @@ class MemoryDependenceAnalysis
public:
typedef MemoryDependenceResults Result;
MemoryDependenceResults run(Function &F, AnalysisManager<Function> &AM);
MemoryDependenceResults run(Function &F, FunctionAnalysisManager &AM);
};
/// A wrapper analysis pass for the legacy pass manager that exposes a \c

View File

@ -68,7 +68,7 @@ class ObjCARCAA : public AnalysisInfoMixin<ObjCARCAA> {
public:
typedef ObjCARCAAResult Result;
ObjCARCAAResult run(Function &F, AnalysisManager<Function> &AM);
ObjCARCAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the ObjCARCAAResult object.

View File

@ -183,7 +183,7 @@ public:
typedef OptimizationRemarkEmitter Result;
/// \brief Run the analysis pass over a function and produce BFI.
Result run(Function &F, AnalysisManager<Function> &AM);
Result run(Function &F, FunctionAnalysisManager &AM);
};
}
#endif // LLVM_IR_OPTIMIZATIONDIAGNOSTICINFO_H

View File

@ -58,7 +58,7 @@ class PostDominatorTreePrinterPass
public:
explicit PostDominatorTreePrinterPass(raw_ostream &OS);
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
struct PostDominatorTreeWrapperPass : public FunctionPass {

View File

@ -937,7 +937,7 @@ class RegionInfoAnalysis : public AnalysisInfoMixin<RegionInfoAnalysis> {
public:
typedef RegionInfo Result;
RegionInfo run(Function &F, AnalysisManager<Function> &AM);
RegionInfo run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for the \c RegionInfo.
@ -946,12 +946,12 @@ class RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> {
public:
explicit RegionInfoPrinterPass(raw_ostream &OS);
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Verifier pass for the \c RegionInfo.
struct RegionInfoVerifierPass : PassInfoMixin<RegionInfoVerifierPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
template <>

View File

@ -1681,7 +1681,7 @@ namespace llvm {
public:
typedef ScalarEvolution Result;
ScalarEvolution run(Function &F, AnalysisManager<Function> &AM);
ScalarEvolution run(Function &F, FunctionAnalysisManager &AM);
};
/// Printer pass for the \c ScalarEvolutionAnalysis results.
@ -1691,7 +1691,7 @@ namespace llvm {
public:
explicit ScalarEvolutionPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
class ScalarEvolutionWrapperPass : public FunctionPass {

View File

@ -45,7 +45,7 @@ class SCEVAA : public AnalysisInfoMixin<SCEVAA> {
public:
typedef SCEVAAResult Result;
SCEVAAResult run(Function &F, AnalysisManager<Function> &AM);
SCEVAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the SCEVAAResult object.

View File

@ -54,7 +54,7 @@ class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> {
public:
typedef ScopedNoAliasAAResult Result;
ScopedNoAliasAAResult run(Function &F, AnalysisManager<Function> &AM);
ScopedNoAliasAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the ScopedNoAliasAAResult object.

View File

@ -1028,7 +1028,7 @@ public:
return *this;
}
Result run(const Function &F, AnalysisManager<Function> &);
Result run(const Function &F, FunctionAnalysisManager &);
private:
friend AnalysisInfoMixin<TargetIRAnalysis>;

View File

@ -55,7 +55,7 @@ class TypeBasedAA : public AnalysisInfoMixin<TypeBasedAA> {
public:
typedef TypeBasedAAResult Result;
TypeBasedAAResult run(Function &F, AnalysisManager<Function> &AM);
TypeBasedAAResult run(Function &F, FunctionAnalysisManager &AM);
};
/// Legacy wrapper pass to provide the TypeBasedAAResult object.

View File

@ -208,7 +208,7 @@ public:
typedef DominatorTree Result;
/// \brief Run the analysis pass over a function and produce a dominator tree.
DominatorTree run(Function &F, AnalysisManager<Function> &);
DominatorTree run(Function &F, FunctionAnalysisManager &);
};
/// \brief Printer pass for the \c DominatorTree.
@ -218,12 +218,12 @@ class DominatorTreePrinterPass
public:
explicit DominatorTreePrinterPass(raw_ostream &OS);
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Verifier pass for the \c DominatorTree.
struct DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Legacy analysis pass which computes a \c DominatorTree.

View File

@ -43,7 +43,7 @@ public:
return *this;
}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief The legacy pass manager's instcombine pass.

View File

@ -22,7 +22,7 @@ namespace llvm {
/// Basic Dead Code Elimination pass.
class DCEPass : public PassInfoMixin<DCEPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -27,7 +27,7 @@ namespace llvm {
/// only the redundant stores that are local to a single Basic Block.
class DSEPass : public PassInfoMixin<DSEPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &FAM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
};
}

View File

@ -28,7 +28,7 @@ namespace llvm {
/// expected that a later pass of GVN will catch the interesting/hard cases.
struct EarlyCSEPass : PassInfoMixin<EarlyCSEPass> {
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -45,7 +45,7 @@ class GVN : public PassInfoMixin<GVN> {
public:
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
/// This removes the specified instruction from
/// our various maps and marks it for deletion.
@ -232,7 +232,7 @@ FunctionPass *createGVNPass(bool NoLoads = false);
/// from sibling branches.
struct GVNHoistPass : PassInfoMixin<GVNHoistPass> {
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -24,7 +24,7 @@ namespace llvm {
class Function;
struct GuardWideningPass : public PassInfoMixin<GuardWideningPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -98,7 +98,7 @@ public:
bool HasProfileData_, std::unique_ptr<BlockFrequencyInfo> BFI_,
std::unique_ptr<BranchProbabilityInfo> BPI_);
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
void releaseMemory() {
BFI.reset();

View File

@ -31,7 +31,7 @@ namespace llvm {
class MergedLoadStoreMotionPass
: public PassInfoMixin<MergedLoadStoreMotionPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -23,7 +23,7 @@ namespace llvm {
class PartiallyInlineLibCallsPass
: public PassInfoMixin<PartiallyInlineLibCallsPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -29,7 +29,7 @@ namespace llvm {
/// This pass performs function-level constant propagation and merging.
class SCCPPass : public PassInfoMixin<SCCPPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -102,7 +102,7 @@ public:
SROA() : C(nullptr), DT(nullptr), AC(nullptr) {}
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
private:
friend class sroa::AllocaSliceRewriter;

View File

@ -36,7 +36,7 @@ public:
SimplifyCFGPass(int BonusInstThreshold);
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -23,7 +23,7 @@ namespace llvm {
/// Move instructions into successor blocks when possible.
class SinkingPass : public PassInfoMixin<SinkingPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -22,7 +22,7 @@ namespace llvm {
class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
} // end namespace llvm

View File

@ -37,7 +37,7 @@ namespace llvm {
/// Converts loops into loop-closed SSA form.
class LCSSAPass : public PassInfoMixin<LCSSAPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
} // end namespace llvm

View File

@ -49,7 +49,7 @@ namespace llvm {
/// This pass is responsible for loop canonicalization.
class LoopSimplifyPass : public PassInfoMixin<LoopSimplifyPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Simplify each loop in a loop nest recursively.

View File

@ -21,7 +21,7 @@
namespace llvm {
class PromotePass : public PassInfoMixin<PromotePass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
}

View File

@ -689,7 +689,7 @@ public:
std::unique_ptr<MemorySSA> MSSA;
};
Result run(Function &F, AnalysisManager<Function> &AM);
Result run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Printer pass for \c MemorySSA.
@ -698,12 +698,12 @@ class MemorySSAPrinterPass : public PassInfoMixin<MemorySSAPrinterPass> {
public:
explicit MemorySSAPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Verifier pass for \c MemorySSA.
struct MemorySSAVerifierPass : PassInfoMixin<MemorySSAVerifierPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
/// \brief Legacy analysis pass which computes \c MemorySSA.

View File

@ -24,7 +24,7 @@ namespace llvm {
/// This pass removes redundant instructions.
class InstSimplifierPass : public PassInfoMixin<InstSimplifierPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
} // end namespace llvm

View File

@ -88,7 +88,7 @@ static inline bool isInterestingPointer(Value *V) {
&& !isa<ConstantPointerNull>(V);
}
PreservedAnalyses AAEvaluator::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses AAEvaluator::run(Function &F, FunctionAnalysisManager &AM) {
runInternal(F, AM.getResult<AAManager>(F));
return PreservedAnalyses::all();
}

View File

@ -77,7 +77,7 @@ void AssumptionCache::registerAssumption(CallInst *CI) {
char AssumptionAnalysis::PassID;
PreservedAnalyses AssumptionPrinterPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
AssumptionCache &AC = AM.getResult<AssumptionAnalysis>(F);
OS << "Cached assumptions for function: " << F.getName() << "\n";

View File

@ -1669,7 +1669,7 @@ bool BasicAAResult::constantOffsetHeuristic(
char BasicAA::PassID;
BasicAAResult BasicAA::run(Function &F, AnalysisManager<Function> &AM) {
BasicAAResult BasicAA::run(Function &F, FunctionAnalysisManager &AM) {
return BasicAAResult(F.getParent()->getDataLayout(),
AM.getResult<TargetLibraryAnalysis>(F),
AM.getResult<AssumptionAnalysis>(F),

View File

@ -257,7 +257,7 @@ bool BlockFrequencyInfoWrapperPass::runOnFunction(Function &F) {
char BlockFrequencyAnalysis::PassID;
BlockFrequencyInfo BlockFrequencyAnalysis::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
BlockFrequencyInfo BFI;
BFI.calculate(F, AM.getResult<BranchProbabilityAnalysis>(F),
AM.getResult<LoopAnalysis>(F));
@ -265,7 +265,7 @@ BlockFrequencyInfo BlockFrequencyAnalysis::run(Function &F,
}
PreservedAnalyses
BlockFrequencyPrinterPass::run(Function &F, AnalysisManager<Function> &AM) {
BlockFrequencyPrinterPass::run(Function &F, FunctionAnalysisManager &AM) {
OS << "Printing analysis results of BFI for function "
<< "'" << F.getName() << "':"
<< "\n";

View File

@ -703,14 +703,14 @@ void BranchProbabilityInfoWrapperPass::print(raw_ostream &OS,
char BranchProbabilityAnalysis::PassID;
BranchProbabilityInfo
BranchProbabilityAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
BranchProbabilityAnalysis::run(Function &F, FunctionAnalysisManager &AM) {
BranchProbabilityInfo BPI;
BPI.calculate(F, AM.getResult<LoopAnalysis>(F));
return BPI;
}
PreservedAnalyses
BranchProbabilityPrinterPass::run(Function &F, AnalysisManager<Function> &AM) {
BranchProbabilityPrinterPass::run(Function &F, FunctionAnalysisManager &AM) {
OS << "Printing analysis results of BPI for function "
<< "'" << F.getName() << "':"
<< "\n";

View File

@ -869,7 +869,7 @@ AliasResult CFLAndersAAResult::alias(const MemoryLocation &LocA,
char CFLAndersAA::PassID;
CFLAndersAAResult CFLAndersAA::run(Function &F, AnalysisManager<Function> &AM) {
CFLAndersAAResult CFLAndersAA::run(Function &F, FunctionAnalysisManager &AM) {
return CFLAndersAAResult(AM.getResult<TargetLibraryAnalysis>(F));
}

View File

@ -343,7 +343,7 @@ AliasResult CFLSteensAAResult::query(const MemoryLocation &LocA,
char CFLSteensAA::PassID;
CFLSteensAAResult CFLSteensAA::run(Function &F, AnalysisManager<Function> &AM) {
CFLSteensAAResult CFLSteensAA::run(Function &F, FunctionAnalysisManager &AM) {
return CFLSteensAAResult(AM.getResult<TargetLibraryAnalysis>(F));
}

View File

@ -389,7 +389,7 @@ FunctionPass *llvm::createDemandedBitsWrapperPass() {
char DemandedBitsAnalysis::PassID;
DemandedBits DemandedBitsAnalysis::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto &AC = AM.getResult<AssumptionAnalysis>(F);
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
return DemandedBits(F, AC, DT);

View File

@ -2031,7 +2031,7 @@ INITIALIZE_PASS_END(LoopAccessLegacyAnalysis, LAA_NAME, laa_name, false, true)
char LoopAccessAnalysis::PassID;
LoopAccessInfo LoopAccessAnalysis::run(Loop &L, AnalysisManager<Loop> &AM) {
const AnalysisManager<Function> &FAM =
const FunctionAnalysisManager &FAM =
AM.getResult<FunctionAnalysisManagerLoopProxy>(L).getManager();
Function &F = *L.getHeader()->getParent();
auto *SE = FAM.getCachedResult<ScalarEvolutionAnalysis>(F);

View File

@ -651,7 +651,7 @@ void LoopInfo::markAsRemoved(Loop *Unloop) {
char LoopAnalysis::PassID;
LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
LoopInfo LoopAnalysis::run(Function &F, FunctionAnalysisManager &AM) {
// FIXME: Currently we create a LoopInfo from scratch for every function.
// This may prove to be too wasteful due to deallocating and re-allocating
// memory each time for the underlying map and vector datastructures. At some
@ -664,7 +664,7 @@ LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
}
PreservedAnalyses LoopPrinterPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
AM.getResult<LoopAnalysis>(F).print(OS);
return PreservedAnalyses::all();
}
@ -720,7 +720,7 @@ void LoopInfoWrapperPass::print(raw_ostream &OS, const Module *) const {
}
PreservedAnalyses LoopVerifierPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
LoopInfo &LI = AM.getResult<LoopAnalysis>(F);
LI.verify();
return PreservedAnalyses::all();

View File

@ -1662,7 +1662,7 @@ void MemoryDependenceResults::verifyRemoved(Instruction *D) const {
char MemoryDependenceAnalysis::PassID;
MemoryDependenceResults
MemoryDependenceAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
MemoryDependenceAnalysis::run(Function &F, FunctionAnalysisManager &AM) {
auto &AA = AM.getResult<AAManager>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);

View File

@ -131,7 +131,7 @@ ModRefInfo ObjCARCAAResult::getModRefInfo(ImmutableCallSite CS,
return AAResultBase::getModRefInfo(CS, Loc);
}
ObjCARCAAResult ObjCARCAA::run(Function &F, AnalysisManager<Function> &AM) {
ObjCARCAAResult ObjCARCAA::run(Function &F, FunctionAnalysisManager &AM) {
return ObjCARCAAResult(F.getParent()->getDataLayout());
}

View File

@ -119,7 +119,7 @@ char OptimizationRemarkEmitterAnalysis::PassID;
OptimizationRemarkEmitter
OptimizationRemarkEmitterAnalysis::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
BlockFrequencyInfo *BFI;
if (F.getContext().getDiagnosticHotnessRequested())

View File

@ -184,7 +184,7 @@ namespace llvm {
char RegionInfoAnalysis::PassID;
RegionInfo RegionInfoAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
RegionInfo RegionInfoAnalysis::run(Function &F, FunctionAnalysisManager &AM) {
RegionInfo RI;
auto *DT = &AM.getResult<DominatorTreeAnalysis>(F);
auto *PDT = &AM.getResult<PostDominatorTreeAnalysis>(F);
@ -206,7 +206,7 @@ PreservedAnalyses RegionInfoPrinterPass::run(Function &F,
}
PreservedAnalyses RegionInfoVerifierPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
AM.getResult<RegionInfoAnalysis>(F).verifyAnalysis();
return PreservedAnalyses::all();

View File

@ -9999,7 +9999,7 @@ void ScalarEvolution::verify() const {
char ScalarEvolutionAnalysis::PassID;
ScalarEvolution ScalarEvolutionAnalysis::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
return ScalarEvolution(F, AM.getResult<TargetLibraryAnalysis>(F),
AM.getResult<AssumptionAnalysis>(F),
AM.getResult<DominatorTreeAnalysis>(F),
@ -10007,7 +10007,7 @@ ScalarEvolution ScalarEvolutionAnalysis::run(Function &F,
}
PreservedAnalyses
ScalarEvolutionPrinterPass::run(Function &F, AnalysisManager<Function> &AM) {
ScalarEvolutionPrinterPass::run(Function &F, FunctionAnalysisManager &AM) {
AM.getResult<ScalarEvolutionAnalysis>(F).print(OS);
return PreservedAnalyses::all();
}

View File

@ -112,7 +112,7 @@ Value *SCEVAAResult::GetBaseValue(const SCEV *S) {
char SCEVAA::PassID;
SCEVAAResult SCEVAA::run(Function &F, AnalysisManager<Function> &AM) {
SCEVAAResult SCEVAA::run(Function &F, FunctionAnalysisManager &AM) {
return SCEVAAResult(AM.getResult<ScalarEvolutionAnalysis>(F));
}

View File

@ -175,7 +175,7 @@ bool ScopedNoAliasAAResult::mayAliasInScopes(const MDNode *Scopes,
char ScopedNoAliasAA::PassID;
ScopedNoAliasAAResult ScopedNoAliasAA::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
return ScopedNoAliasAAResult();
}

View File

@ -427,7 +427,7 @@ TargetIRAnalysis::TargetIRAnalysis(
: TTICallback(std::move(TTICallback)) {}
TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F,
AnalysisManager<Function> &) {
FunctionAnalysisManager &) {
return TTICallback(F);
}
@ -458,7 +458,7 @@ TargetTransformInfoWrapperPass::TargetTransformInfoWrapperPass(
}
TargetTransformInfo &TargetTransformInfoWrapperPass::getTTI(const Function &F) {
AnalysisManager<Function> DummyFAM;
FunctionAnalysisManager DummyFAM;
TTI = TIRA.run(F, DummyFAM);
return *TTI;
}

View File

@ -585,7 +585,7 @@ bool TypeBasedAAResult::PathAliases(const MDNode *A, const MDNode *B) const {
char TypeBasedAA::PassID;
TypeBasedAAResult TypeBasedAA::run(Function &F, AnalysisManager<Function> &AM) {
TypeBasedAAResult TypeBasedAA::run(Function &F, FunctionAnalysisManager &AM) {
return TypeBasedAAResult();
}

View File

@ -301,7 +301,7 @@ void DominatorTree::verifyDomTree() const {
//===----------------------------------------------------------------------===//
DominatorTree DominatorTreeAnalysis::run(Function &F,
AnalysisManager<Function> &) {
FunctionAnalysisManager &) {
DominatorTree DT;
DT.recalculate(F);
return DT;

View File

@ -43,7 +43,7 @@ PrintFunctionPass::PrintFunctionPass(raw_ostream &OS, const std::string &Banner)
: OS(OS), Banner(Banner) {}
PreservedAnalyses PrintFunctionPass::run(Function &F,
AnalysisManager<Function> &) {
FunctionAnalysisManager &) {
if (isFunctionInPrintList(F.getName()))
OS << Banner << static_cast<Value &>(F);
return PreservedAnalyses::all();

View File

@ -176,7 +176,7 @@ public:
/// \brief No-op function pass which does nothing.
struct NoOpFunctionPass {
PreservedAnalyses run(Function &F, AnalysisManager<Function> &) {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &) {
return PreservedAnalyses::all();
}
static StringRef name() { return "NoOpFunctionPass"; }
@ -189,7 +189,7 @@ class NoOpFunctionAnalysis : public AnalysisInfoMixin<NoOpFunctionAnalysis> {
public:
struct Result {};
Result run(Function &, AnalysisManager<Function> &) { return Result(); }
Result run(Function &, FunctionAnalysisManager &) { return Result(); }
static StringRef name() { return "NoOpFunctionAnalysis"; }
};

View File

@ -3173,7 +3173,7 @@ combineInstructionsOverFunction(Function &F, InstCombineWorklist &Worklist,
}
PreservedAnalyses InstCombinePass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto &AC = AM.getResult<AssumptionAnalysis>(F);
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);

View File

@ -123,7 +123,7 @@ static bool eliminateDeadCode(Function &F, TargetLibraryInfo *TLI) {
return MadeChange;
}
PreservedAnalyses DCEPass::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses DCEPass::run(Function &F, FunctionAnalysisManager &AM) {
if (eliminateDeadCode(F, AM.getCachedResult<TargetLibraryAnalysis>(F)))
return PreservedAnalyses::none();
return PreservedAnalyses::all();

View File

@ -847,7 +847,7 @@ bool EarlyCSE::run() {
}
PreservedAnalyses EarlyCSEPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
auto &TTI = AM.getResult<TargetIRAnalysis>(F);
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);

View File

@ -583,7 +583,7 @@ void GVN::ValueTable::verifyRemoved(const Value *V) const {
// GVN Pass
//===----------------------------------------------------------------------===//
PreservedAnalyses GVN::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses GVN::run(Function &F, FunctionAnalysisManager &AM) {
// FIXME: The order of evaluation of these 'getResult' calls is very
// significant! Re-ordering these variables will cause GVN when run alone to
// be less effective! We should fix memdep and basic-aa to not exhibit this

View File

@ -940,7 +940,7 @@ public:
} // namespace
PreservedAnalyses GVNHoistPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
DominatorTree &DT = AM.getResult<DominatorTreeAnalysis>(F);
AliasAnalysis &AA = AM.getResult<AAManager>(F);
MemoryDependenceResults &MD = AM.getResult<MemoryDependenceAnalysis>(F);

View File

@ -653,7 +653,7 @@ bool GuardWideningImpl::combineRangeChecks(
}
PreservedAnalyses GuardWideningPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &LI = AM.getResult<LoopAnalysis>(F);
auto &PDT = AM.getResult<PostDominatorTreeAnalysis>(F);

View File

@ -134,7 +134,7 @@ bool JumpThreading::runOnFunction(Function &F) {
}
PreservedAnalyses JumpThreadingPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
auto &LVI = AM.getResult<LazyValueAnalysis>(F);

View File

@ -589,7 +589,7 @@ INITIALIZE_PASS_END(MergedLoadStoreMotionLegacyPass, "mldst-motion",
"MergedLoadStoreMotion", false, false)
PreservedAnalyses
MergedLoadStoreMotionPass::run(Function &F, AnalysisManager<Function> &AM) {
MergedLoadStoreMotionPass::run(Function &F, FunctionAnalysisManager &AM) {
MergedLoadStoreMotion Impl;
auto *MD = AM.getCachedResult<MemoryDependenceAnalysis>(F);
auto &AA = AM.getResult<AAManager>(F);

View File

@ -123,7 +123,7 @@ static bool runPartiallyInlineLibCalls(Function &F, TargetLibraryInfo *TLI,
}
PreservedAnalyses
PartiallyInlineLibCallsPass::run(Function &F, AnalysisManager<Function> &AM) {
PartiallyInlineLibCallsPass::run(Function &F, FunctionAnalysisManager &AM) {
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
auto &TTI = AM.getResult<TargetIRAnalysis>(F);
if (!runPartiallyInlineLibCalls(F, &TLI, &TTI))

View File

@ -1631,7 +1631,7 @@ static bool runSCCP(Function &F, const DataLayout &DL,
return MadeChanges;
}
PreservedAnalyses SCCPPass::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses SCCPPass::run(Function &F, FunctionAnalysisManager &AM) {
const DataLayout &DL = F.getParent()->getDataLayout();
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
if (!runSCCP(F, DL, &TLI))

View File

@ -4253,7 +4253,7 @@ PreservedAnalyses SROA::runImpl(Function &F, DominatorTree &RunDT,
return PA;
}
PreservedAnalyses SROA::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses SROA::run(Function &F, FunctionAnalysisManager &AM) {
return runImpl(F, AM.getResult<DominatorTreeAnalysis>(F),
AM.getResult<AssumptionAnalysis>(F));
}

View File

@ -187,7 +187,7 @@ SimplifyCFGPass::SimplifyCFGPass(int BonusInstThreshold)
: BonusInstThreshold(BonusInstThreshold) {}
PreservedAnalyses SimplifyCFGPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto &TTI = AM.getResult<TargetIRAnalysis>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);

View File

@ -254,7 +254,7 @@ static bool iterativelySinkInstructions(Function &F, DominatorTree &DT,
return EverMadeChange;
}
PreservedAnalyses SinkingPass::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses SinkingPass::run(Function &F, FunctionAnalysisManager &AM) {
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &LI = AM.getResult<LoopAnalysis>(F);
auto &AA = AM.getResult<AAManager>(F);

View File

@ -249,7 +249,7 @@ bool AddDiscriminatorsLegacyPass::runOnFunction(Function &F) {
return addDiscriminators(F);
}
PreservedAnalyses AddDiscriminatorsPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
if (!addDiscriminators(F))
return PreservedAnalyses::all();

View File

@ -360,7 +360,7 @@ bool LCSSAWrapperPass::runOnFunction(Function &F) {
return formLCSSAOnAllLoops(LI, *DT, SE);
}
PreservedAnalyses LCSSAPass::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses LCSSAPass::run(Function &F, FunctionAnalysisManager &AM) {
auto &LI = AM.getResult<LoopAnalysis>(F);
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto *SE = AM.getCachedResult<ScalarEvolutionAnalysis>(F);

View File

@ -857,7 +857,7 @@ bool LoopSimplify::runOnFunction(Function &F) {
}
PreservedAnalyses LoopSimplifyPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
bool Changed = false;
LoopInfo *LI = &AM.getResult<LoopAnalysis>(F);
DominatorTree *DT = &AM.getResult<DominatorTreeAnalysis>(F);

View File

@ -53,7 +53,7 @@ static bool promoteMemoryToRegister(Function &F, DominatorTree &DT,
return Changed;
}
PreservedAnalyses PromotePass::run(Function &F, AnalysisManager<Function> &AM) {
PreservedAnalyses PromotePass::run(Function &F, FunctionAnalysisManager &AM) {
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);
if (!promoteMemoryToRegister(F, DT, AC))

View File

@ -2079,7 +2079,7 @@ bool MemorySSAPrinterLegacyPass::runOnFunction(Function &F) {
char MemorySSAAnalysis::PassID;
MemorySSAAnalysis::Result
MemorySSAAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
MemorySSAAnalysis::run(Function &F, FunctionAnalysisManager &AM) {
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &AA = AM.getResult<AAManager>(F);
return MemorySSAAnalysis::Result(make_unique<MemorySSA>(F, &AA, &DT));

View File

@ -126,7 +126,7 @@ FunctionPass *llvm::createInstructionSimplifierPass() {
}
PreservedAnalyses InstSimplifierPass::run(Function &F,
AnalysisManager<Function> &AM) {
FunctionAnalysisManager &AM) {
auto *DT = AM.getCachedResult<DominatorTreeAnalysis>(F);
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);

View File

@ -198,7 +198,7 @@ struct TestSCCPass {
struct TestFunctionPass {
TestFunctionPass(int &RunCount) : RunCount(RunCount) {}
PreservedAnalyses run(Function &F, AnalysisManager<Function> &) {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &) {
++RunCount;
return PreservedAnalyses::none();
}