LLVM  13.0.0git
ReplayInlineAdvisor.h
Go to the documentation of this file.
1 //===- ReplayInlineAdvisor.h - Replay Inline Advisor interface -*- C++ --*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 #ifndef LLVM_ANALYSIS_REPLAYINLINEADVISOR_H
10 #define LLVM_ANALYSIS_REPLAYINLINEADVISOR_H
11 
12 #include "llvm/ADT/StringSet.h"
14 #include "llvm/IR/LLVMContext.h"
15 
16 namespace llvm {
17 class BasicBlock;
18 class CallBase;
19 class Function;
20 class Module;
21 class OptimizationRemarkEmitter;
22 
23 /// Replay inline advisor that uses optimization remarks from inlining of
24 /// previous build to guide current inlining. This is useful for inliner tuning.
26 public:
29  std::unique_ptr<InlineAdvisor> OriginalAdvisor,
30  StringRef RemarksFile, bool EmitRemarks);
31  std::unique_ptr<InlineAdvice> getAdviceImpl(CallBase &CB) override;
32  bool areReplayRemarksLoaded() const { return HasReplayRemarks; }
33 
34 private:
35  StringSet<> InlineSitesFromRemarks;
36  std::unique_ptr<InlineAdvisor> OriginalAdvisor;
37  bool HasReplayRemarks = false;
38  bool EmitRemarks = false;
39 };
40 } // namespace llvm
41 #endif // LLVM_ANALYSIS_REPLAYINLINEADVISOR_H
llvm
Definition: AllocatorList.h:23
llvm::InlineAdvisor::M
Module & M
Definition: InlineAdvisor.h:170
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::ReplayInlineAdvisor::ReplayInlineAdvisor
ReplayInlineAdvisor(Module &M, FunctionAnalysisManager &FAM, LLVMContext &Context, std::unique_ptr< InlineAdvisor > OriginalAdvisor, StringRef RemarksFile, bool EmitRemarks)
Definition: ReplayInlineAdvisor.cpp:25
InlineAdvisor.h
llvm::ReplayInlineAdvisor::areReplayRemarksLoaded
bool areReplayRemarksLoaded() const
Definition: ReplayInlineAdvisor.h:32
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:64
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::StringSet
StringSet - A wrapper for StringMap that provides set-like functionality.
Definition: StringSet.h:22
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::InlineAdvisor
Interface for deciding whether to inline a call site or not.
Definition: InlineAdvisor.h:140
llvm::ReplayInlineAdvisor
Replay inline advisor that uses optimization remarks from inlining of previous build to guide current...
Definition: ReplayInlineAdvisor.h:25
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
StringSet.h
llvm::InlineAdvisor::FAM
FunctionAnalysisManager & FAM
Definition: InlineAdvisor.h:171
llvm::ReplayInlineAdvisor::getAdviceImpl
std::unique_ptr< InlineAdvice > getAdviceImpl(CallBase &CB) override
Definition: ReplayInlineAdvisor.cpp:60
llvm::CallBase
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition: InstrTypes.h:1164
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
LLVMContext.h
llvm::codeview::PublicSymFlags::Function
@ Function