LLVM  14.0.0git
MIRSampleProfile.h
Go to the documentation of this file.
1 //===----- MIRSampleProfile.h: SampleFDO Support in MIR ---*- 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 // This file contains the supoorting functions for machine level Sample FDO
10 // loader. This is used in Flow Sensitive SampelFDO.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MIRSAMPLEPROFILE_H
15 #define LLVM_CODEGEN_MIRSAMPLEPROFILE_H
16 
28 #include "llvm/CodeGen/Passes.h"
30 #include "llvm/IR/Function.h"
31 #include "llvm/IR/Module.h"
32 #include "llvm/InitializePasses.h"
36 
37 #include <cassert>
38 
39 namespace llvm {
40 
41 using namespace sampleprof;
42 
43 class MIRProfileLoader;
45  MachineFunction *MF;
46  std::string ProfileFileName;
48  unsigned LowBit;
49  unsigned HighBit;
50 
51 public:
52  static char ID;
53  /// FS bits will only use the '1' bits in the Mask.
54  MIRProfileLoaderPass(std::string FileName = "",
55  std::string RemappingFileName = "",
57 
58  /// getMachineFunction - Return the last machine function computed.
59  const MachineFunction *getMachineFunction() const { return MF; }
60 
61  StringRef getPassName() const override { return "SampleFDO loader in MIR"; }
62 
63 private:
64  void init(MachineFunction &MF);
65  bool runOnMachineFunction(MachineFunction &) override;
66  bool doInitialization(Module &M) override;
67  void getAnalysisUsage(AnalysisUsage &AU) const override;
68 
69  std::unique_ptr<MIRProfileLoader> MIRSampleLoader;
70  /// Hold the information of the basic block frequency.
72 };
73 
74 } // namespace llvm
75 
76 #endif // LLVM_CODEGEN_MIRSAMPLEPROFILE_H
MachineInstr.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::MIRProfileLoaderPass::getMachineFunction
const MachineFunction * getMachineFunction() const
getMachineFunction - Return the last machine function computed.
Definition: MIRSampleProfile.h:59
DebugInfoMetadata.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
MachineBasicBlock.h
Module.h
llvm::sampleprof::FSDiscriminatorPass
FSDiscriminatorPass
Definition: Discriminator.h:57
MachineLoopInfo.h
llvm::MachineBlockFrequencyInfo
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
Definition: MachineBlockFrequencyInfo.h:33
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
SampleProf.h
llvm::MIRProfileLoaderPass
Definition: MIRSampleProfile.h:44
InstrProf.h
llvm::MIRProfileLoaderPass::getPassName
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: MIRSampleProfile.h:61
MachineOptimizationRemarkEmitter.h
===- MachineOptimizationRemarkEmitter.h - Opt Diagnostics -*- C++ -*-—===//
Passes.h
ProfileSummaryInfo.h
SampleProfReader.h
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:441
MachineFunctionPass.h
MachineBranchProbabilityInfo.h
MachinePostDominators.h
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MachineFunction
Definition: MachineFunction.h:234
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
Function.h
llvm::MIRProfileLoaderPass::ID
static char ID
Definition: MIRSampleProfile.h:52
llvm::sampleprof::Pass1
@ Pass1
Definition: Discriminator.h:60
MachineFunction.h
InitializePasses.h
MachineBlockFrequencyInfo.h
MachineDominators.h