Index: llvm/include/llvm/Analysis/ML/FunctionPropertiesAnalysis.h =================================================================== --- llvm/include/llvm/Analysis/ML/FunctionPropertiesAnalysis.h +++ llvm/include/llvm/Analysis/ML/FunctionPropertiesAnalysis.h @@ -1,13 +1,13 @@ -#ifndef LLVM_INLINEFEATURESANALYSIS_H_ -#define LLVM_INLINEFEATURESANALYSIS_H_ +#ifndef LLVM_FUNCTIONPROPERTIESANALYSIS_H_ +#define LLVM_FUNCTIONPROPERTIESANALYSIS_H_ #include "llvm/IR/PassManager.h" namespace llvm { class Function; -class InlineFeaturesAnalysis - : public AnalysisInfoMixin { +class FunctionPropertiesAnalysis + : public AnalysisInfoMixin { public: static AnalysisKey Key; struct Result { @@ -34,4 +34,4 @@ }; } // namespace llvm -#endif // LLVM_INLINEFEATURESANALYSIS_H_ \ No newline at end of file +#endif // LLVM_FUNCTIONPROPERTIESANALYSIS_H_ \ No newline at end of file Index: llvm/lib/Analysis/ML/CMakeLists.txt =================================================================== --- llvm/lib/Analysis/ML/CMakeLists.txt +++ llvm/lib/Analysis/ML/CMakeLists.txt @@ -1,5 +1,5 @@ add_llvm_component_library(LLVMMLPolicies - InlineFeaturesAnalysis.cpp + FunctionPropertiesAnalysis.cpp DEPENDS intrinsics_gen Index: llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp =================================================================== --- llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp +++ llvm/lib/Analysis/ML/FunctionPropertiesAnalysis.cpp @@ -1,12 +1,12 @@ -#include "llvm/Analysis/ML/InlineFeaturesAnalysis.h" +#include "llvm/Analysis/ML/FunctionPropertiesAnalysis.h" #include "llvm/IR/Instructions.h" using namespace llvm; -AnalysisKey InlineFeaturesAnalysis::Key; +AnalysisKey FunctionPropertiesAnalysis::Key; -InlineFeaturesAnalysis::Result -InlineFeaturesAnalysis::run(const Function &F, FunctionAnalysisManager &FAM) { +FunctionPropertiesAnalysis::Result +FunctionPropertiesAnalysis::run(const Function &F, FunctionAnalysisManager &FAM) { Result Ret; Ret.Uses = ((!F.hasLocalLinkage()) ? 1 : 0) + F.getNumUses(); for (const auto &BB : F) { Index: llvm/lib/Passes/PassBuilder.cpp =================================================================== --- llvm/lib/Passes/PassBuilder.cpp +++ llvm/lib/Passes/PassBuilder.cpp @@ -40,7 +40,7 @@ #include "llvm/Analysis/LoopCacheAnalysis.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopNestAnalysis.h" -#include "llvm/Analysis/ML/InlineFeaturesAnalysis.h" +#include "llvm/Analysis/ML/FunctionPropertiesAnalysis.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Analysis/MemorySSA.h" #include "llvm/Analysis/ModuleSummaryAnalysis.h" Index: llvm/lib/Passes/PassRegistry.def =================================================================== --- llvm/lib/Passes/PassRegistry.def +++ llvm/lib/Passes/PassRegistry.def @@ -133,7 +133,7 @@ FUNCTION_ANALYSIS("loops", LoopAnalysis()) FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis()) FUNCTION_ANALYSIS("da", DependenceAnalysis()) -FUNCTION_ANALYSIS("inliner-features", InlineFeaturesAnalysis()) +FUNCTION_ANALYSIS("func-properties", FunctionPropertiesAnalysis()) FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis()) FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis()) FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis()) Index: llvm/unittests/Analysis/ML/CMakeLists.txt =================================================================== --- llvm/unittests/Analysis/ML/CMakeLists.txt +++ llvm/unittests/Analysis/ML/CMakeLists.txt @@ -8,5 +8,5 @@ ) add_llvm_unittest(MLAnalysisTests - InlineFeaturesAnalysisTest.cpp + FunctionPropertiesAnalysisTest.cpp ) Index: llvm/unittests/Analysis/ML/FunctionPropertiesAnalysisTest.cpp =================================================================== --- llvm/unittests/Analysis/ML/FunctionPropertiesAnalysisTest.cpp +++ llvm/unittests/Analysis/ML/FunctionPropertiesAnalysisTest.cpp @@ -1,4 +1,4 @@ -//===- InlineFeaturesAnalysisTest.cpp - inline features unit tests --------===// +//===- FunctionPropertiesAnalysisTest.cpp - function properties unit tests --------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/ML/InlineFeaturesAnalysis.h" +#include "llvm/Analysis/ML/FunctionPropertiesAnalysis.h" #include "llvm/AsmParser/Parser.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h" @@ -24,7 +24,7 @@ return Mod; } -TEST(InlineFeaturesTest, BasicTest) { +TEST(FunctionPropertiesTest, BasicTest) { LLVMContext C; std::unique_ptr M = parseIR(C, R"IR( @@ -59,7 +59,7 @@ )IR"); FunctionAnalysisManager FAM; - InlineFeaturesAnalysis FA; + FunctionPropertiesAnalysis FA; auto BranchesFeatures = FA.run(*M->getFunction("branches"), FAM); EXPECT_EQ(BranchesFeatures.BasicBlockCount, 4);