LLVM  14.0.0git
MIRSampleProfile.cpp
Go to the documentation of this file.
1 //===-------- MIRSampleProfile.cpp: MIRSampleFDO (For FSAFDO) -------------===//
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 provides the implementation of the MIRSampleProfile loader, mainly
10 // for flow sensitive SampleFDO.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "llvm/ADT/DenseMap.h"
16 #include "llvm/ADT/DenseSet.h"
18 #include "llvm/IR/Function.h"
20 #include "llvm/Support/Debug.h"
24 
25 using namespace llvm;
26 using namespace sampleprof;
27 using namespace llvm::sampleprofutil;
29 
30 #define DEBUG_TYPE "fs-profile-loader"
31 
33  "show-fs-branchprob", cl::Hidden, cl::init(false),
34  cl::desc("Print setting flow sensitive branch probabilities"));
36  "fs-profile-debug-prob-diff-threshold", cl::init(10),
37  cl::desc("Only show debug message if the branch probility is greater than "
38  "this value (in percentage)."));
39 
41  "fs-profile-debug-bw-threshold", cl::init(10000),
42  cl::desc("Only show debug message if the source branch weight is greater "
43  " than this value."));
44 
45 static cl::opt<bool> ViewBFIBefore("fs-viewbfi-before", cl::Hidden,
46  cl::init(false),
47  cl::desc("View BFI before MIR loader"));
48 static cl::opt<bool> ViewBFIAfter("fs-viewbfi-after", cl::Hidden,
49  cl::init(false),
50  cl::desc("View BFI after MIR loader"));
51 
53 
55  "Load MIR Sample Profile",
56  /* cfg = */ false, /* is_analysis = */ false)
63  /* cfg = */ false, /* is_analysis = */ false)
64 
66 
68  std::string RemappingFile,
70  return new MIRProfileLoaderPass(File, RemappingFile, P);
71 }
72 
73 namespace llvm {
74 
75 // Internal option used to control BFI display only after MBP pass.
76 // Defined in CodeGen/MachineBlockFrequencyInfo.cpp:
77 // -view-block-layout-with-bfi={none | fraction | integer | count}
79 
80 // Command line option to specify the name of the function for CFG dump
81 // Defined in Analysis/BlockFrequencyInfo.cpp: -view-bfi-func-name=
83 
84 namespace afdo_detail {
85 template <> struct IRTraits<MachineBasicBlock> {
90  using LoopT = MachineLoop;
99  static Function &getFunction(MachineFunction &F) { return F.getFunction(); }
102  }
104  return BB->predecessors();
105  }
107  return BB->successors();
108  }
109 };
110 } // namespace afdo_detail
111 
112 class MIRProfileLoader final
113  : public SampleProfileLoaderBaseImpl<MachineBasicBlock> {
114 public:
118  DT = MDT;
119  PDT = MPDT;
120  LI = MLI;
121  BFI = MBFI;
122  ORE = MORE;
123  }
125  P = Pass;
126  LowBit = getFSPassBitBegin(P);
127  HighBit = getFSPassBitEnd(P);
128  assert(LowBit < HighBit && "HighBit needs to be greater than Lowbit");
129  }
130 
133  }
134 
135  void setBranchProbs(MachineFunction &F);
137  bool doInitialization(Module &M);
138  bool isValid() const { return ProfileIsValid; }
139 
140 protected:
141  friend class SampleCoverageTracker;
142 
143  /// Hold the information of the basic block frequency.
145 
146  /// PassNum is the sequence number this pass is called, start from 1.
148 
149  // LowBit in the FS discriminator used by this instance. Note the number is
150  // 0-based. Base discrimnator use bit 0 to bit 11.
151  unsigned LowBit;
152  // HighwBit in the FS discriminator used by this instance. Note the number
153  // is 0-based.
154  unsigned HighBit;
155 
156  bool ProfileIsValid = true;
157 };
158 
159 template <>
161  MachineBasicBlock>::computeDominanceAndLoopInfo(MachineFunction &F) {}
162 
164  LLVM_DEBUG(dbgs() << "\nPropagation complete. Setting branch probs\n");
165  for (auto &BI : F) {
166  MachineBasicBlock *BB = &BI;
167  if (BB->succ_size() < 2)
168  continue;
169  const MachineBasicBlock *EC = EquivalenceClass[BB];
170  uint64_t BBWeight = BlockWeights[EC];
171  uint64_t SumEdgeWeight = 0;
172  for (MachineBasicBlock *Succ : BB->successors()) {
173  Edge E = std::make_pair(BB, Succ);
174  SumEdgeWeight += EdgeWeights[E];
175  }
176 
177  if (BBWeight != SumEdgeWeight) {
178  LLVM_DEBUG(dbgs() << "BBweight is not equal to SumEdgeWeight: BBWWeight="
179  << BBWeight << " SumEdgeWeight= " << SumEdgeWeight
180  << "\n");
181  BBWeight = SumEdgeWeight;
182  }
183  if (BBWeight == 0) {
184  LLVM_DEBUG(dbgs() << "SKIPPED. All branch weights are zero.\n");
185  continue;
186  }
187 
188 #ifndef NDEBUG
189  uint64_t BBWeightOrig = BBWeight;
190 #endif
192  uint32_t Factor = 1;
193  if (BBWeight > MaxWeight) {
194  Factor = BBWeight / MaxWeight + 1;
195  BBWeight /= Factor;
196  LLVM_DEBUG(dbgs() << "Scaling weights by " << Factor << "\n");
197  }
198 
199  for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
200  SE = BB->succ_end();
201  SI != SE; ++SI) {
202  MachineBasicBlock *Succ = *SI;
203  Edge E = std::make_pair(BB, Succ);
204  uint64_t EdgeWeight = EdgeWeights[E];
205  EdgeWeight /= Factor;
206 
207  assert(BBWeight >= EdgeWeight &&
208  "BBweight is larger than EdgeWeight -- should not happen.\n");
209 
210  BranchProbability OldProb = BFI->getMBPI()->getEdgeProbability(BB, SI);
211  BranchProbability NewProb(EdgeWeight, BBWeight);
212  if (OldProb == NewProb)
213  continue;
214  BB->setSuccProbability(SI, NewProb);
215 #ifndef NDEBUG
216  if (!ShowFSBranchProb)
217  continue;
218  bool Show = false;
219  BranchProbability Diff;
220  if (OldProb > NewProb)
221  Diff = OldProb - NewProb;
222  else
223  Diff = NewProb - OldProb;
224  Show = (Diff >= BranchProbability(FSProfileDebugProbDiffThreshold, 100));
225  Show &= (BBWeightOrig >= FSProfileDebugBWThreshold);
226 
227  auto DIL = BB->findBranchDebugLoc();
228  auto SuccDIL = Succ->findBranchDebugLoc();
229  if (Show) {
230  dbgs() << "Set branch fs prob: MBB (" << BB->getNumber() << " -> "
231  << Succ->getNumber() << "): ";
232  if (DIL)
233  dbgs() << DIL->getFilename() << ":" << DIL->getLine() << ":"
234  << DIL->getColumn();
235  if (SuccDIL)
236  dbgs() << "-->" << SuccDIL->getFilename() << ":" << SuccDIL->getLine()
237  << ":" << SuccDIL->getColumn();
238  dbgs() << " W=" << BBWeightOrig << " " << OldProb << " --> " << NewProb
239  << "\n";
240  }
241 #endif
242  }
243  }
244 }
245 
247  auto &Ctx = M.getContext();
248 
249  auto ReaderOrErr = sampleprof::SampleProfileReader::create(Filename, Ctx, P,
250  RemappingFilename);
251  if (std::error_code EC = ReaderOrErr.getError()) {
252  std::string Msg = "Could not open profile: " + EC.message();
253  Ctx.diagnose(DiagnosticInfoSampleProfile(Filename, Msg));
254  return false;
255  }
256 
257  Reader = std::move(ReaderOrErr.get());
258  Reader->setModule(&M);
259  ProfileIsValid = (Reader->read() == sampleprof_error::success);
260  Reader->getSummary();
261 
262  return true;
263 }
264 
266  Function &Func = MF.getFunction();
267  clearFunctionData(false);
268  Samples = Reader->getSamplesFor(Func);
269  if (!Samples || Samples->empty())
270  return false;
271 
272  if (getFunctionLoc(MF) == 0)
273  return false;
274 
275  DenseSet<GlobalValue::GUID> InlinedGUIDs;
276  bool Changed = computeAndPropagateWeights(MF, InlinedGUIDs);
277 
278  // Set the new BPI, BFI.
279  setBranchProbs(MF);
280 
281  return Changed;
282 }
283 
284 } // namespace llvm
285 
287  std::string RemappingFileName,
289  : MachineFunctionPass(ID), ProfileFileName(FileName), P(P),
290  MIRSampleLoader(
291  std::make_unique<MIRProfileLoader>(FileName, RemappingFileName)) {
292  LowBit = getFSPassBitBegin(P);
293  HighBit = getFSPassBitEnd(P);
294  assert(LowBit < HighBit && "HighBit needs to be greater than Lowbit");
295 }
296 
297 bool MIRProfileLoaderPass::runOnMachineFunction(MachineFunction &MF) {
298  if (!MIRSampleLoader->isValid())
299  return false;
300 
301  LLVM_DEBUG(dbgs() << "MIRProfileLoader pass working on Func: "
302  << MF.getFunction().getName() << "\n");
303  MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
304  MIRSampleLoader->setInitVals(
305  &getAnalysis<MachineDominatorTree>(),
306  &getAnalysis<MachinePostDominatorTree>(), &getAnalysis<MachineLoopInfo>(),
307  MBFI, &getAnalysis<MachineOptimizationRemarkEmitterPass>().getORE());
308 
309  MF.RenumberBlocks();
311  (ViewBlockFreqFuncName.empty() ||
313  MBFI->view("MIR_Prof_loader_b." + MF.getName(), false);
314  }
315 
316  bool Changed = MIRSampleLoader->runOnFunction(MF);
317  if (Changed)
318  MBFI->calculate(MF, *MBFI->getMBPI(), *&getAnalysis<MachineLoopInfo>());
319 
321  (ViewBlockFreqFuncName.empty() ||
323  MBFI->view("MIR_prof_loader_a." + MF.getName(), false);
324  }
325 
326  return Changed;
327 }
328 
329 bool MIRProfileLoaderPass::doInitialization(Module &M) {
330  LLVM_DEBUG(dbgs() << "MIRProfileLoader pass working on Module " << M.getName()
331  << "\n");
332 
333  MIRSampleLoader->setFSPass(P);
334  return MIRSampleLoader->doInitialization(M);
335 }
336 
337 void MIRProfileLoaderPass::getAnalysisUsage(AnalysisUsage &AU) const {
338  AU.setPreservesAll();
345 }
llvm::getFSPassBitBegin
static unsigned getFSPassBitBegin(FSDiscriminatorPass P)
Definition: Discriminator.h:96
ProfileCount
Function::ProfileCount ProfileCount
Definition: MIRSampleProfile.cpp:28
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
Pass
print lazy value Lazy Value Info Printer Pass
Definition: LazyValueInfo.cpp:1981
llvm::afdo_detail::IRTraits< MachineBasicBlock >::getFunction
static Function & getFunction(MachineFunction &F)
Definition: MIRSampleProfile.cpp:99
llvm::Function
Definition: Function.h:62
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::SampleProfileLoaderBaseImpl
Definition: SampleProfileLoaderBaseImpl.h:80
llvm::MachineOptimizationRemarkEmitter
The optimization diagnostic interface.
Definition: MachineOptimizationRemarkEmitter.h:150
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:143
llvm::MachineBlockFrequencyInfo::view
void view(const Twine &Name, bool isSimple=true) const
Pop up a ghostview window with the current block frequency propagation rendered using dot.
Definition: MachineBlockFrequencyInfo.cpp:224
llvm::afdo_detail::IRTraits< MachineBasicBlock >::getEntryBB
static const MachineBasicBlock * getEntryBB(const MachineFunction *F)
Definition: MIRSampleProfile.cpp:100
llvm::MIRProfileLoader
Definition: MIRSampleProfile.cpp:112
DenseMap.h
llvm::MIRProfileLoader::BFI
MachineBlockFrequencyInfo * BFI
Hold the information of the basic block frequency.
Definition: MIRSampleProfile.cpp:144
llvm::MachineFunctionPass::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Definition: MachineFunctionPass.cpp:102
LLVM_DEBUG
#define LLVM_DEBUG(X)
Definition: Debug.h:101
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::MachineLoopInfo
Definition: MachineLoopInfo.h:90
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
llvm::sampleprof::FSDiscriminatorPass
FSDiscriminatorPass
Definition: Discriminator.h:57
CommandLine.h
BlockFrequencyInfoImpl.h
INITIALIZE_PASS_BEGIN
INITIALIZE_PASS_BEGIN(MIRProfileLoaderPass, DEBUG_TYPE, "Load MIR Sample Profile", false, false) INITIALIZE_PASS_END(MIRProfileLoaderPass
llvm::MIRProfileLoader::LowBit
unsigned LowBit
Definition: MIRSampleProfile.cpp:151
llvm::MachineBlockFrequencyInfo
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
Definition: MachineBlockFrequencyInfo.h:33
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MIRProfileLoader::setFSPass
void setFSPass(FSDiscriminatorPass Pass)
Definition: MIRSampleProfile.cpp:124
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
llvm::SPII::Load
@ Load
Definition: SparcInstrInfo.h:32
DenseSet.h
false
Definition: StackSlotColoring.cpp:142
llvm::MachineBlockFrequencyInfo::calculate
void calculate(const MachineFunction &F, const MachineBranchProbabilityInfo &MBPI, const MachineLoopInfo &MLI)
calculate - compute block frequency info for the given function.
Definition: MachineBlockFrequencyInfo.cpp:194
llvm::MIRProfileLoaderPass::MIRProfileLoaderPass
MIRProfileLoaderPass(std::string FileName="", std::string RemappingFileName="", FSDiscriminatorPass P=FSDiscriminatorPass::Pass1)
FS bits will only use the '1' bits in the Mask.
Definition: MIRSampleProfile.cpp:286
llvm::MIRProfileLoaderPass
Definition: MIRSampleProfile.h:44
llvm::createMIRProfileLoaderPass
FunctionPass * createMIRProfileLoaderPass(std::string File, std::string RemappingFile, sampleprof::FSDiscriminatorPass P)
Read Flow Sensitive Profile.
Definition: MIRSampleProfile.cpp:67
llvm::MachineOptimizationRemarkAnalysis
Diagnostic information for optimization analysis remarks.
Definition: MachineOptimizationRemarkEmitter.h:108
llvm::MIRProfileLoader::isValid
bool isValid() const
Definition: MIRSampleProfile.cpp:138
SampleProfileLoaderBaseUtil.h
llvm::afdo_detail::IRTraits< MachineBasicBlock >::getPredecessors
static PredRangeT getPredecessors(MachineBasicBlock *BB)
Definition: MIRSampleProfile.cpp:103
FSProfileDebugBWThreshold
static cl::opt< unsigned > FSProfileDebugBWThreshold("fs-profile-debug-bw-threshold", cl::init(10000), cl::desc("Only show debug message if the source branch weight is greater " " than this value."))
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::StringRef::equals
LLVM_NODISCARD bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Definition: StringRef.h:186
INITIALIZE_PASS_END
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:58
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition: DenseSet.h:268
llvm::MachineBasicBlock::succ_iterator
std::vector< MachineBasicBlock * >::iterator succ_iterator
Definition: MachineBasicBlock.h:310
llvm::cl::opt< bool >
llvm::MIRProfileLoader::setInitVals
void setInitVals(MachineDominatorTree *MDT, MachinePostDominatorTree *MPDT, MachineLoopInfo *MLI, MachineBlockFrequencyInfo *MBFI, MachineOptimizationRemarkEmitter *MORE)
Definition: MIRSampleProfile.cpp:115
llvm::MachineLoop
Definition: MachineLoopInfo.h:45
llvm::MIRProfileLoaderPassID
char & MIRProfileLoaderPassID
This pass reads flow sensitive profile.
Definition: MIRSampleProfile.cpp:65
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
uint64_t
llvm::ViewBlockLayoutWithBFI
cl::opt< GVDAGType > ViewBlockLayoutWithBFI("view-block-layout-with-bfi", cl::Hidden, cl::desc("Pop up a window to show a dag displaying MBP layout and associated " "block frequencies of the CFG."), cl::values(clEnumValN(GVDT_None, "none", "do not display graphs."), clEnumValN(GVDT_Fraction, "fraction", "display a graph using the " "fractional block frequency representation."), clEnumValN(GVDT_Integer, "integer", "display a graph using the raw " "integer fractional block frequency representation."), clEnumValN(GVDT_Count, "count", "display a graph using the real " "profile count if available.")))
Definition: MachineBlockPlacement.cpp:215
INITIALIZE_PASS_DEPENDENCY
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
DEBUG_TYPE
#define DEBUG_TYPE
Definition: MIRSampleProfile.cpp:30
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:441
llvm::MachineFunction::getName
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Definition: MachineFunction.cpp:546
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MIRProfileLoader::doInitialization
bool doInitialization(Module &M)
Definition: MIRSampleProfile.cpp:246
SI
StandardInstrumentations SI(Debug, VerifyEach)
llvm::MIRProfileLoader::HighBit
unsigned HighBit
Definition: MIRSampleProfile.cpp:154
llvm::sampleprof::SampleProfileReader::create
static ErrorOr< std::unique_ptr< SampleProfileReader > > create(const std::string Filename, LLVMContext &C, FSDiscriminatorPass P=FSDiscriminatorPass::Base, const std::string RemapFilename="")
Create a sample profile reader appropriate to the file format.
Definition: SampleProfReader.cpp:1787
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::MIRProfileLoader::runOnFunction
bool runOnFunction(MachineFunction &F)
Definition: MIRSampleProfile.cpp:265
llvm::MachineFunction
Definition: MachineFunction.h:241
llvm::DiagnosticInfoSampleProfile
Diagnostic information for the sample profiler.
Definition: DiagnosticInfo.h:286
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition: MachineBasicBlock.h:1073
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::MachineBasicBlock::findBranchDebugLoc
DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
Definition: MachineBasicBlock.cpp:1411
llvm::MachineOptimizationRemarkEmitterPass
The analysis pass.
Definition: MachineOptimizationRemarkEmitter.h:218
uint32_t
llvm::BranchProbability
Definition: BranchProbability.h:30
Profile
Load MIR Sample Profile
Definition: MIRSampleProfile.cpp:62
SampleProfileLoaderBaseImpl.h
llvm::AMDGPUISD::BFI
@ BFI
Definition: AMDGPUISelLowering.h:431
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:309
FSProfileDebugProbDiffThreshold
static cl::opt< unsigned > FSProfileDebugProbDiffThreshold("fs-profile-debug-prob-diff-threshold", cl::init(10), cl::desc("Only show debug message if the branch probility is greater than " "this value (in percentage)."))
MORE
#define MORE()
Definition: regcomp.c:252
llvm::MachinePostDominatorTree
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
Definition: MachinePostDominators.h:27
llvm::sampleprofutil
Definition: SampleProfileLoaderBaseUtil.h:39
llvm::MIRProfileLoader::P
FSDiscriminatorPass P
PassNum is the sequence number this pass is called, start from 1.
Definition: MIRSampleProfile.cpp:147
runOnFunction
static bool runOnFunction(Function &F, bool PostInlining)
Definition: EntryExitInstrumenter.cpp:69
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:838
MIRSampleProfile.h
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition: MachineFunction.h:607
llvm::AnalysisUsage::setPreservesAll
void setPreservesAll()
Set by analyses that do not transform their input at all.
Definition: PassAnalysisSupport.h:130
llvm::afdo_detail::IRTraits< MachineBasicBlock >::getSuccessors
static SuccRangeT getSuccessors(MachineBasicBlock *BB)
Definition: MIRSampleProfile.cpp:106
llvm::MIRProfileLoader::setBranchProbs
void setBranchProbs(MachineFunction &F)
Definition: MIRSampleProfile.cpp:163
Function.h
llvm::MIRProfileLoaderPass::ID
static char ID
Definition: MIRSampleProfile.h:52
llvm::sampleprofutil::SampleCoverageTracker
Definition: SampleProfileLoaderBaseUtil.h:41
ViewBFIBefore
static cl::opt< bool > ViewBFIBefore("fs-viewbfi-before", cl::Hidden, cl::init(false), cl::desc("View BFI before MIR loader"))
llvm::sampleprof_error::success
@ success
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:91
llvm::SampleProfileLoaderBaseImpl< MachineBasicBlock >::Edge
std::pair< const BasicBlockT *, const BasicBlockT * > Edge
Definition: SampleProfileLoaderBaseImpl.h:109
llvm::GVDT_None
@ GVDT_None
Definition: BlockFrequencyInfoImpl.h:1811
llvm::afdo_detail::IRTraits
Definition: SampleProfileLoaderBaseImpl.h:53
llvm::MachineBlockFrequencyInfo::getMBPI
const MachineBranchProbabilityInfo * getMBPI() const
Definition: MachineBlockFrequencyInfo.cpp:273
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::AnalysisUsage::addRequiredTransitive
AnalysisUsage & addRequiredTransitive()
Definition: PassAnalysisSupport.h:81
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
llvm::getFSPassBitEnd
static unsigned getFSPassBitEnd(FSDiscriminatorPass P)
Definition: Discriminator.h:89
llvm::ViewBlockFreqFuncName
cl::opt< std::string > ViewBlockFreqFuncName("view-bfi-func-name", cl::Hidden, cl::desc("The option to specify " "the name of the function " "whose CFG will be displayed."))
Definition: MachineBlockFrequencyInfo.cpp:66
llvm::AnalysisUsage::addRequired
AnalysisUsage & addRequired()
Definition: PassAnalysisSupport.h:75
llvm::GraphTraits
Definition: GraphTraits.h:35
llvm::Function::ProfileCount
Class to represent profile counts.
Definition: Function.h:255
ViewBFIAfter
static cl::opt< bool > ViewBFIAfter("fs-viewbfi-after", cl::Hidden, cl::init(false), cl::desc("View BFI after MIR loader"))
llvm::cl::desc
Definition: CommandLine.h:412
raw_ostream.h
llvm::MachineDominatorTree
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Definition: MachineDominators.h:46
llvm::MIRProfileLoader::MIRProfileLoader
MIRProfileLoader(StringRef Name, StringRef RemapName)
Definition: MIRSampleProfile.cpp:131
ShowFSBranchProb
static cl::opt< bool > ShowFSBranchProb("show-fs-branchprob", cl::Hidden, cl::init(false), cl::desc("Print setting flow sensitive branch probabilities"))
Debug.h
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:205
llvm::MachineFunction::RenumberBlocks
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them.
Definition: MachineFunction.cpp:300
SpecialSubKind::string
@ string
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38