1 //===- InlineSizeEstimatorAnalysis.h - ML size estimator --------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_ANALYSIS_INLINESIZEESTIMATORANALYSIS_H
11 #define LLVM_ANALYSIS_INLINESIZEESTIMATORANALYSIS_H
13 #include "llvm/IR/PassManager.h"
18 class TFModelEvaluator;
19 class InlineSizeEstimatorAnalysis
20 : public AnalysisInfoMixin<InlineSizeEstimatorAnalysis> {
22 InlineSizeEstimatorAnalysis();
23 InlineSizeEstimatorAnalysis(InlineSizeEstimatorAnalysis &&);
24 ~InlineSizeEstimatorAnalysis();
26 static AnalysisKey Key;
27 using Result = Optional<size_t>;
28 Result run(const Function &F, FunctionAnalysisManager &FAM);
29 static bool isEvaluatorRequested();
32 std::unique_ptr<TFModelEvaluator> Evaluator;
35 #endif // LLVM_ANALYSIS_INLINESIZEESTIMATORANALYSIS_H