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_iterator SI = BB->succ_begin(),
173  SE = BB->succ_end();
174  SI != SE; ++SI) {
175  MachineBasicBlock *Succ = *SI;
176  Edge E = std::make_pair(BB, Succ);
177  SumEdgeWeight += EdgeWeights[E];
178  }
179 
180  if (BBWeight != SumEdgeWeight) {
181  LLVM_DEBUG(dbgs() << "BBweight is not equal to SumEdgeWeight: BBWWeight="
182  << BBWeight << " SumEdgeWeight= " << SumEdgeWeight
183  << "\n");
184  BBWeight = SumEdgeWeight;
185  }
186  if (BBWeight == 0) {
187  LLVM_DEBUG(dbgs() << "SKIPPED. All branch weights are zero.\n");
188  continue;
189  }
190 
191 #ifndef NDEBUG
192  uint64_t BBWeightOrig = BBWeight;
193 #endif
195  uint32_t Factor = 1;
196  if (BBWeight > MaxWeight) {
197  Factor = BBWeight / MaxWeight + 1;
198  BBWeight /= Factor;
199  LLVM_DEBUG(dbgs() << "Scaling weights by " << Factor << "\n");
200  }
201 
202  for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
203  SE = BB->succ_end();
204  SI != SE; ++SI) {
205  MachineBasicBlock *Succ = *SI;
206  Edge E = std::make_pair(BB, Succ);
207  uint64_t EdgeWeight = EdgeWeights[E];
208  EdgeWeight /= Factor;
209 
210  assert(BBWeight >= EdgeWeight &&
211  "BBweight is larger than EdgeWeight -- should not happen.\n");
212 
213  BranchProbability OldProb = BFI->getMBPI()->getEdgeProbability(BB, SI);
214  BranchProbability NewProb(EdgeWeight, BBWeight);
215  if (OldProb == NewProb)
216  continue;
217  BB->setSuccProbability(SI, NewProb);
218 #ifndef NDEBUG
219  if (!ShowFSBranchProb)
220  continue;
221  bool Show = false;
222  BranchProbability Diff;
223  if (OldProb > NewProb)
224  Diff = OldProb - NewProb;
225  else
226  Diff = NewProb - OldProb;
227  Show = (Diff >= BranchProbability(FSProfileDebugProbDiffThreshold, 100));
228  Show &= (BBWeightOrig >= FSProfileDebugBWThreshold);
229 
230  auto DIL = BB->findBranchDebugLoc();
231  auto SuccDIL = Succ->findBranchDebugLoc();
232  if (Show) {
233  dbgs() << "Set branch fs prob: MBB (" << BB->getNumber() << " -> "
234  << Succ->getNumber() << "): ";
235  if (DIL)
236  dbgs() << DIL->getFilename() << ":" << DIL->getLine() << ":"
237  << DIL->getColumn();
238  if (SuccDIL)
239  dbgs() << "-->" << SuccDIL->getFilename() << ":" << SuccDIL->getLine()
240  << ":" << SuccDIL->getColumn();
241  dbgs() << " W=" << BBWeightOrig << " " << OldProb << " --> " << NewProb
242  << "\n";
243  }
244 #endif
245  }
246  }
247 }
248 
250  auto &Ctx = M.getContext();
251 
252  auto ReaderOrErr = sampleprof::SampleProfileReader::create(Filename, Ctx, P,
253  RemappingFilename);
254  if (std::error_code EC = ReaderOrErr.getError()) {
255  std::string Msg = "Could not open profile: " + EC.message();
256  Ctx.diagnose(DiagnosticInfoSampleProfile(Filename, Msg));
257  return false;
258  }
259 
260  Reader = std::move(ReaderOrErr.get());
261  Reader->setModule(&M);
262  ProfileIsValid = (Reader->read() == sampleprof_error::success);
263  Reader->getSummary();
264 
265  return true;
266 }
267 
269  Function &Func = MF.getFunction();
270  clearFunctionData(false);
271  Samples = Reader->getSamplesFor(Func);
272  if (!Samples || Samples->empty())
273  return false;
274 
275  if (getFunctionLoc(MF) == 0)
276  return false;
277 
278  DenseSet<GlobalValue::GUID> InlinedGUIDs;
279  bool Changed = computeAndPropagateWeights(MF, InlinedGUIDs);
280 
281  // Set the new BPI, BFI.
282  setBranchProbs(MF);
283 
284  return Changed;
285 }
286 
287 } // namespace llvm
288 
290  std::string RemappingFileName,
292  : MachineFunctionPass(ID), ProfileFileName(FileName), P(P),
293  MIRSampleLoader(
294  std::make_unique<MIRProfileLoader>(FileName, RemappingFileName)) {
295  LowBit = getFSPassBitBegin(P);
296  HighBit = getFSPassBitEnd(P);
297  assert(LowBit < HighBit && "HighBit needs to be greater than Lowbit");
298 }
299 
300 bool MIRProfileLoaderPass::runOnMachineFunction(MachineFunction &MF) {
301  if (!MIRSampleLoader->isValid())
302  return false;
303 
304  LLVM_DEBUG(dbgs() << "MIRProfileLoader pass working on Func: "
305  << MF.getFunction().getName() << "\n");
306  MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
307  MIRSampleLoader->setInitVals(
308  &getAnalysis<MachineDominatorTree>(),
309  &getAnalysis<MachinePostDominatorTree>(), &getAnalysis<MachineLoopInfo>(),
310  MBFI, &getAnalysis<MachineOptimizationRemarkEmitterPass>().getORE());
311 
312  MF.RenumberBlocks();
314  (ViewBlockFreqFuncName.empty() ||
316  MBFI->view("MIR_Prof_loader_b." + MF.getName(), false);
317  }
318 
319  bool Changed = MIRSampleLoader->runOnFunction(MF);
320 
322  (ViewBlockFreqFuncName.empty() ||
324  MBFI->view("MIR_prof_loader_a." + MF.getName(), false);
325  }
326 
327  return Changed;
328 }
329 
330 bool MIRProfileLoaderPass::doInitialization(Module &M) {
331  LLVM_DEBUG(dbgs() << "MIRProfileLoader pass working on Module " << M.getName()
332  << "\n");
333 
334  MIRSampleLoader->setFSPass(P);
335  return MIRSampleLoader->doInitialization(M);
336 }
337 
338 void MIRProfileLoaderPass::getAnalysisUsage(AnalysisUsage &AU) const {
339  AU.setPreservesAll();
346 }
llvm::getFSPassBitBegin
static unsigned getFSPassBitBegin(FSDiscriminatorPass P)
Definition: Discriminator.h:96
ProfileCount
Function::ProfileCount ProfileCount
Definition: MIRSampleProfile.cpp:28
llvm
This file implements support for optimizing divisions by a constant.
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:1965
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:77
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::SPII::Load
@ Load
Definition: SparcInstrInfo.h:32
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:56
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
DenseSet.h
false
Definition: StackSlotColoring.cpp:142
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:289
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:187
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:306
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:203
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:541
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MIRProfileLoader::doInitialization
bool doInitialization(Module &M)
Definition: MIRSampleProfile.cpp:249
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:1725
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MIRProfileLoader::runOnFunction
bool runOnFunction(MachineFunction &F)
Definition: MIRSampleProfile.cpp:268
llvm::MachineFunction
Definition: MachineFunction.h:230
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:1056
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::MachineBasicBlock::findBranchDebugLoc
DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
Definition: MachineBasicBlock.cpp:1417
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:421
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:592
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:106
llvm::GVDT_None
@ GVDT_None
Definition: BlockFrequencyInfoImpl.h:1810
llvm::afdo_detail::IRTraits
Definition: SampleProfileLoaderBaseImpl.h:52
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:45
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:294
SpecialSubKind::string
@ string
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37