llvm.org GIT mirror llvm / fd5a3b4
[PM] name the new PM LAA class LoopAccessAnalysis (LAA) /NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274934 91177308-0d34-0410-b5e6-96231b3b80d8 Xinliang David Li 4 years ago
3 changed file(s) with 16 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
771771 LoopInfo *LI;
772772 };
773773
774 /// \brief LoopAccessInfoAnalysis
775 class LoopAccessInfoAnalysis
776 : public AnalysisInfoMixin {
777 friend AnalysisInfoMixin;
774 /// \brief This analysis provides dependence information for the memory
775 /// accesses of a loop.
776 ///
777 /// It runs the analysis for a loop on demand. This can be initiated by
778 /// querying the loop access info via AM.getResult.
779 /// getResult return a LoopAccessInfo object. See this class for the
780 /// specifics of what information is provided.
781 class LoopAccessAnalysis
782 : public AnalysisInfoMixin {
783 friend AnalysisInfoMixin;
778784 static char PassID;
779785
780786 public:
781787 typedef LoopAccessInfo Result;
782788 Result run(Loop &, AnalysisManager &);
783 static StringRef name() { return "LoopAccessInfoAnalysis"; }
789 static StringRef name() { return "LoopAccessAnalysis"; }
784790 };
785791
786792 /// \brief Printer pass for the \c LoopAccessInfo results.
20232023 INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
20242024 INITIALIZE_PASS_END(LoopAccessLegacyAnalysis, LAA_NAME, laa_name, false, true)
20252025
2026 char LoopAccessInfoAnalysis::PassID;
2027
2028 LoopAccessInfo LoopAccessInfoAnalysis::run(Loop &L, AnalysisManager &AM) {
2026 char LoopAccessAnalysis::PassID;
2027
2028 LoopAccessInfo LoopAccessAnalysis::run(Loop &L, AnalysisManager &AM) {
20292029 const AnalysisManager &FAM =
20302030 AM.getResult(L).getManager();
20312031 Function &F = *L.getHeader()->getParent();
20502050 PreservedAnalyses LoopAccessInfoPrinterPass::run(Loop &L,
20512051 AnalysisManager &AM) {
20522052 Function &F = *L.getHeader()->getParent();
2053 auto &LAI = AM.getResultInfoAnalysis>(L);
2053 auto &LAI = AM.getResultAnalysis>(L);
20542054 OS << "Loop access info in function '" << F.getName() << "':\n";
20552055 OS.indent(2) << L.getHeader()->getName() << ":\n";
20562056 LAI.print(OS, 4);
175175 #define LOOP_ANALYSIS(NAME, CREATE_PASS)
176176 #endif
177177 LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis())
178 LOOP_ANALYSIS("access-info", LoopAccessInfoAnalysis())
178 LOOP_ANALYSIS("access-info", LoopAccessAnalysis())
179179 #undef LOOP_ANALYSIS
180180
181181 #ifndef LOOP_PASS