LLVM 22.0.0git
FunctionPropertiesAnalysis.cpp
Go to the documentation of this file.
1//===- FunctionPropertiesAnalysis.cpp - Function Properties Analysis ------===//
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 defines the FunctionPropertiesInfo and FunctionPropertiesAnalysis
10// classes used to extract function properties.
11//
12//===----------------------------------------------------------------------===//
13
15#include "llvm/ADT/STLExtras.h"
16#include "llvm/ADT/SetVector.h"
17#include "llvm/ADT/Statistic.h"
19#include "llvm/IR/CFG.h"
20#include "llvm/IR/Constants.h"
21#include "llvm/IR/Dominators.h"
26#include <deque>
27
28using namespace llvm;
29
30#define DEBUG_TYPE "func-properties-stats"
31
32#define FUNCTION_PROPERTY(Name, Description) \
33 STATISTIC(Total##Name, Description);
34#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
35 STATISTIC(Total##Name, Description);
36#include "llvm/IR/FunctionProperties.def"
37
38namespace llvm {
40 "enable-detailed-function-properties", cl::Hidden, cl::init(false),
41 cl::desc("Whether or not to compute detailed function properties."));
42
44 "big-basic-block-instruction-threshold", cl::Hidden, cl::init(500),
45 cl::desc("The minimum number of instructions a basic block should contain "
46 "before being considered big."));
47
49 "medium-basic-block-instruction-threshold", cl::Hidden, cl::init(15),
50 cl::desc("The minimum number of instructions a basic block should contain "
51 "before being considered medium-sized."));
52} // namespace llvm
53
55 "call-with-many-arguments-threshold", cl::Hidden, cl::init(4),
56 cl::desc("The minimum number of arguments a function call must have before "
57 "it is considered having many arguments."));
58
59namespace {
60int64_t getNumBlocksFromCond(const BasicBlock &BB) {
61 int64_t Ret = 0;
62 if (const auto *BI = dyn_cast<BranchInst>(BB.getTerminator())) {
63 if (BI->isConditional())
64 Ret += BI->getNumSuccessors();
65 } else if (const auto *SI = dyn_cast<SwitchInst>(BB.getTerminator())) {
66 Ret += (SI->getNumCases() + (nullptr != SI->getDefaultDest()));
67 }
68 return Ret;
69}
70
71int64_t getUses(const Function &F) {
72 return ((!F.hasLocalLinkage()) ? 1 : 0) + F.getNumUses();
73}
74} // namespace
75
76void FunctionPropertiesInfo::reIncludeBB(const BasicBlock &BB) {
77 updateForBB(BB, +1);
78}
79
80void FunctionPropertiesInfo::updateForBB(const BasicBlock &BB,
81 int64_t Direction) {
82 assert(Direction == 1 || Direction == -1);
85 (Direction * getNumBlocksFromCond(BB));
86 for (const auto &I : BB) {
87 if (auto *CS = dyn_cast<CallBase>(&I)) {
88 const auto *Callee = CS->getCalledFunction();
89 if (Callee && !Callee->isIntrinsic() && !Callee->isDeclaration())
91 }
92 if (I.getOpcode() == Instruction::Load) {
94 } else if (I.getOpcode() == Instruction::Store) {
96 }
97 }
98 TotalInstructionCount += Direction * BB.sizeWithoutDebug();
99
101 unsigned SuccessorCount = succ_size(&BB);
102 if (SuccessorCount == 1)
104 else if (SuccessorCount == 2)
106 else if (SuccessorCount > 2)
108
109 unsigned PredecessorCount = pred_size(&BB);
110 if (PredecessorCount == 1)
112 else if (PredecessorCount == 2)
114 else if (PredecessorCount > 2)
116
121 else
123
124 // Calculate critical edges by looking through all successors of a basic
125 // block that has multiple successors and finding ones that have multiple
126 // predecessors, which represent critical edges.
127 if (SuccessorCount > 1) {
128 for (const auto *Successor : successors(&BB)) {
129 if (pred_size(Successor) > 1)
131 }
132 }
133
134 ControlFlowEdgeCount += Direction * SuccessorCount;
135
136 const Instruction *TI = BB.getTerminator();
137 const int64_t InstructionSuccessorCount = TI->getNumSuccessors();
138 if (isa<BranchInst>(TI)) {
140 BranchSuccessorCount += Direction * InstructionSuccessorCount;
141 const auto *BI = dyn_cast<BranchInst>(TI);
142 if (BI->isConditional())
144 else
146 } else if (isa<SwitchInst>(TI)) {
148 SwitchSuccessorCount += Direction * InstructionSuccessorCount;
149 }
150
151 for (const Instruction &I : BB.instructionsWithoutDebug()) {
152 if (I.isCast())
154
155 if (I.getType()->isFloatTy())
157 else if (I.getType()->isIntegerTy())
159
162
163 if (const auto *Call = dyn_cast<CallInst>(&I)) {
164 if (Call->isIndirectCall())
166 else
168
169 if (Call->getType()->isIntegerTy())
171 else if (Call->getType()->isFloatingPointTy())
173 else if (Call->getType()->isPointerTy())
175 else if (Call->getType()->isVectorTy()) {
180 else if (Call->getType()->getScalarType()->isPointerTy())
182 }
183
186
187 for (const auto &Arg : Call->args()) {
188 if (Arg->getType()->isPointerTy()) {
190 break;
191 }
192 }
193 }
194
195#define COUNT_OPERAND(OPTYPE) \
196 if (isa<OPTYPE>(Operand)) { \
197 OPTYPE##OperandCount += Direction; \
198 continue; \
199 }
200
201 for (unsigned int OperandIndex = 0; OperandIndex < I.getNumOperands();
202 ++OperandIndex) {
203 Value *Operand = I.getOperand(OperandIndex);
204 COUNT_OPERAND(GlobalValue)
205 COUNT_OPERAND(ConstantInt)
206 COUNT_OPERAND(ConstantFP)
207 COUNT_OPERAND(Constant)
208 COUNT_OPERAND(Instruction)
209 COUNT_OPERAND(BasicBlock)
210 COUNT_OPERAND(InlineAsm)
211 COUNT_OPERAND(Argument)
212
213 // We only get to this point if we haven't matched any of the other
214 // operand types.
216 }
217
218#undef CHECK_OPERAND
219 }
220 }
221
222 if (IR2VecVocab) {
223 // We instantiate the IR2Vec embedder each time, as having an unique
224 // pointer to the embedder as member of the class would make it
225 // non-copyable. Instantiating the embedder in itself is not costly.
227 *BB.getParent(), *IR2VecVocab);
228 if (!Embedder) {
229 BB.getContext().emitError("Error creating IR2Vec embeddings");
230 return;
231 }
232 const auto &BBEmbedding = Embedder->getBBVector(BB);
233 // Subtract BBEmbedding from Function embedding if the direction is -1,
234 // and add it if the direction is +1.
235 if (Direction == -1)
236 FunctionEmbedding -= BBEmbedding;
237 else
238 FunctionEmbedding += BBEmbedding;
239 }
240}
241
242void FunctionPropertiesInfo::updateAggregateStats(const Function &F,
243 const LoopInfo &LI) {
244
245 Uses = getUses(F);
247 MaxLoopDepth = 0;
248 std::deque<const Loop *> Worklist;
249 llvm::append_range(Worklist, LI);
250 while (!Worklist.empty()) {
251 const auto *L = Worklist.front();
253 std::max(MaxLoopDepth, static_cast<int64_t>(L->getLoopDepth()));
254 Worklist.pop_front();
255 llvm::append_range(Worklist, L->getSubLoops());
256 }
257}
258
261 // We use the cached result of the IR2VecVocabAnalysis run by
262 // InlineAdvisorAnalysis. If the IR2VecVocabAnalysis is not run, we don't
263 // use IR2Vec embeddings.
264 auto Vocabulary = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F)
265 .getCachedResult<IR2VecVocabAnalysis>(*F.getParent());
267 FAM.getResult<LoopAnalysis>(F), Vocabulary);
268}
269
271 const Function &F, const DominatorTree &DT, const LoopInfo &LI,
272 const ir2vec::Vocabulary *Vocabulary) {
273
275 if (Vocabulary && Vocabulary->isValid()) {
276 FPI.IR2VecVocab = Vocabulary;
277 FPI.FunctionEmbedding = ir2vec::Embedding(Vocabulary->getDimension(), 0.0);
278 }
279 for (const auto &BB : F)
280 if (DT.isReachableFromEntry(&BB))
281 FPI.reIncludeBB(BB);
282 FPI.updateAggregateStats(F, LI);
283 return FPI;
284}
285
287 const FunctionPropertiesInfo &FPI) const {
288 if (BasicBlockCount != FPI.BasicBlockCount ||
291 Uses != FPI.Uses ||
295 MaxLoopDepth != FPI.MaxLoopDepth ||
336 return false;
337 }
338 // Check the equality of the function embeddings. We don't check the equality
339 // of Vocabulary as it remains the same.
340 if (!FunctionEmbedding.approximatelyEquals(FPI.FunctionEmbedding))
341 return false;
342
343 return true;
344}
345
347#define FUNCTION_PROPERTY(Name, Description) OS << #Name ": " << Name << "\n";
348
349#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
350 if (EnableDetailedFunctionProperties) { \
351 OS << #Name ": " << Name << "\n"; \
352 }
353
354#include "llvm/IR/FunctionProperties.def"
355
356#undef FUNCTION_PROPERTY
357#undef DETAILED_FUNCTION_PROPERTY
358
359 OS << "\n";
360}
361
363
368
371 OS << "Printing analysis results of CFA for function "
372 << "'" << F.getName() << "':"
373 << "\n";
375 return PreservedAnalyses::all();
376}
377
381 LLVM_DEBUG(dbgs() << "STATSCOUNT: running on function " << F.getName()
382 << "\n");
383 auto &AnalysisResults = FAM.getResult<FunctionPropertiesAnalysis>(F);
384
385#define FUNCTION_PROPERTY(Name, Description) \
386 Total##Name += AnalysisResults.Name;
387#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
388 Total##Name += AnalysisResults.Name;
389#include "llvm/IR/FunctionProperties.def"
390
391 return PreservedAnalyses::all();
392}
393
396 : FPI(FPI), CallSiteBB(*CB.getParent()), Caller(*CallSiteBB.getParent()) {
398 // For BBs that are likely to change, we subtract from feature totals their
399 // contribution. Some features, like max loop counts or depths, are left
400 // invalid, as they will be updated post-inlining.
401 SmallPtrSet<const BasicBlock *, 4> LikelyToChangeBBs;
402 // The CB BB will change - it'll either be split or the callee's body (single
403 // BB) will be pasted in.
404 LikelyToChangeBBs.insert(&CallSiteBB);
405
406 // The caller's entry BB may change due to new alloca instructions.
407 LikelyToChangeBBs.insert(&*Caller.begin());
408
409 // The users of the value returned by call instruction can change
410 // leading to the change in embeddings being computed, when used.
411 // We conservatively add the BBs with such uses to LikelyToChangeBBs.
412 for (const auto *User : CB.users())
413 CallUsers.insert(dyn_cast<Instruction>(User)->getParent());
414 // CallSiteBB can be removed from CallUsers if present, it's taken care
415 // separately.
416 CallUsers.erase(&CallSiteBB);
417 LikelyToChangeBBs.insert_range(CallUsers);
418
419 // The successors may become unreachable in the case of `invoke` inlining.
420 // We track successors separately, too, because they form a boundary, together
421 // with the CB BB ('Entry') between which the inlined callee will be pasted.
422 Successors.insert_range(successors(&CallSiteBB));
423
424 // the outcome of the inlining may be that some edges get lost (DCEd BBs
425 // because inlining brought some constant, for example). We don't know which
426 // edges will be removed, so we list all of them as potentially removable.
427 // Some BBs have (at this point) duplicate edges. Remove duplicates, otherwise
428 // the DT updater will not apply changes correctly.
430 for (auto *Succ : successors(&CallSiteBB))
431 if (Inserted.insert(Succ).second)
432 DomTreeUpdates.emplace_back(DominatorTree::UpdateKind::Delete,
433 const_cast<BasicBlock *>(&CallSiteBB),
434 const_cast<BasicBlock *>(Succ));
435 // Reuse Inserted (which has some allocated capacity at this point) below, if
436 // we have an invoke.
437 Inserted.clear();
438 // Inlining only handles invoke and calls. If this is an invoke, and inlining
439 // it pulls another invoke, the original landing pad may get split, so as to
440 // share its content with other potential users. So the edge up to which we
441 // need to invalidate and then re-account BB data is the successors of the
442 // current landing pad. We can leave the current lp, too - if it doesn't get
443 // split, then it will be the place traversal stops. Either way, the
444 // discounted BBs will be checked if reachable and re-added.
445 if (const auto *II = dyn_cast<InvokeInst>(&CB)) {
446 const auto *UnwindDest = II->getUnwindDest();
447 Successors.insert_range(successors(UnwindDest));
448 // Same idea as above, we pretend we lose all these edges.
449 for (auto *Succ : successors(UnwindDest))
450 if (Inserted.insert(Succ).second)
451 DomTreeUpdates.emplace_back(DominatorTree::UpdateKind::Delete,
452 const_cast<BasicBlock *>(UnwindDest),
453 const_cast<BasicBlock *>(Succ));
454 }
455
456 // Exclude the CallSiteBB, if it happens to be its own successor (1-BB loop).
457 // We are only interested in BBs the graph moves past the callsite BB to
458 // define the frontier past which we don't want to re-process BBs. Including
459 // the callsite BB in this case would prematurely stop the traversal in
460 // finish().
461 Successors.erase(&CallSiteBB);
462
463 LikelyToChangeBBs.insert_range(Successors);
464
465 // Commit the change. While some of the BBs accounted for above may play dual
466 // role - e.g. caller's entry BB may be the same as the callsite BB - set
467 // insertion semantics make sure we account them once. This needs to be
468 // followed in `finish`, too.
469 for (const auto *BB : LikelyToChangeBBs)
470 FPI.updateForBB(*BB, -1);
471}
472
473DominatorTree &FunctionPropertiesUpdater::getUpdatedDominatorTree(
475 auto &DT =
476 FAM.getResult<DominatorTreeAnalysis>(const_cast<Function &>(Caller));
477
479
481 for (auto *Succ : successors(&CallSiteBB))
482 if (Inserted.insert(Succ).second)
483 FinalDomTreeUpdates.push_back({DominatorTree::UpdateKind::Insert,
484 const_cast<BasicBlock *>(&CallSiteBB),
485 const_cast<BasicBlock *>(Succ)});
486
487 // Perform the deletes last, so that any new nodes connected to nodes
488 // participating in the edge deletion are known to the DT.
489 for (auto &Upd : DomTreeUpdates)
490 if (!llvm::is_contained(successors(Upd.getFrom()), Upd.getTo()))
491 FinalDomTreeUpdates.push_back(Upd);
492
493 DT.applyUpdates(FinalDomTreeUpdates);
494#ifdef EXPENSIVE_CHECKS
495 assert(DT.verify(DominatorTree::VerificationLevel::Full));
496#endif
497 return DT;
498}
499
501 // Update feature values from the BBs that were copied from the callee, or
502 // might have been modified because of inlining. The latter have been
503 // subtracted in the FunctionPropertiesUpdater ctor.
504 // There could be successors that were reached before but now are only
505 // reachable from elsewhere in the CFG.
506 // One example is the following diamond CFG (lines are arrows pointing down):
507 // A
508 // / \
509 // B C
510 // | |
511 // | D
512 // | |
513 // | E
514 // \ /
515 // F
516 // There's a call site in C that is inlined. Upon doing that, it turns out
517 // it expands to
518 // call void @llvm.trap()
519 // unreachable
520 // F isn't reachable from C anymore, but we did discount it when we set up
521 // FunctionPropertiesUpdater, so we need to re-include it here.
522 // At the same time, D and E were reachable before, but now are not anymore,
523 // so we need to leave D out (we discounted it at setup), and explicitly
524 // remove E.
527 auto &DT = getUpdatedDominatorTree(FAM);
528
529 if (&CallSiteBB != &*Caller.begin())
530 Reinclude.insert(&*Caller.begin());
531
532 // Reinclude the BBs which use the values returned by call instruction
533 Reinclude.insert_range(CallUsers);
534
535 // Distribute the successors to the 2 buckets.
536 for (const auto *Succ : Successors)
537 if (DT.isReachableFromEntry(Succ))
538 Reinclude.insert(Succ);
539 else
540 Unreachable.insert(Succ);
541
542 // For reinclusion, we want to stop at the reachable successors, who are at
543 // the beginning of the worklist; but, starting from the callsite bb and
544 // ending at those successors, we also want to perform a traversal.
545 // IncludeSuccessorsMark is the index after which we include successors.
546 const auto IncludeSuccessorsMark = Reinclude.size();
547 bool CSInsertion = Reinclude.insert(&CallSiteBB);
548 (void)CSInsertion;
549 assert(CSInsertion);
550 for (size_t I = 0; I < Reinclude.size(); ++I) {
551 const auto *BB = Reinclude[I];
552 FPI.reIncludeBB(*BB);
553 if (I >= IncludeSuccessorsMark)
554 Reinclude.insert_range(successors(BB));
555 }
556
557 // For exclusion, we don't need to exclude the set of BBs that were successors
558 // before and are now unreachable, because we already did that at setup. For
559 // the rest, as long as a successor is unreachable, we want to explicitly
560 // exclude it.
561 const auto AlreadyExcludedMark = Unreachable.size();
562 for (size_t I = 0; I < Unreachable.size(); ++I) {
563 const auto *U = Unreachable[I];
564 if (I >= AlreadyExcludedMark)
565 FPI.updateForBB(*U, -1);
566 for (const auto *Succ : successors(U))
567 if (!DT.isReachableFromEntry(Succ))
568 Unreachable.insert(Succ);
569 }
570
571 const auto &LI = FAM.getResult<LoopAnalysis>(const_cast<Function &>(Caller));
572 FPI.updateAggregateStats(Caller, LI);
573#ifdef EXPENSIVE_CHECKS
574 assert(isUpdateValid(Caller, FPI, FAM));
575#endif
576}
577
578bool FunctionPropertiesUpdater::isUpdateValid(Function &F,
579 const FunctionPropertiesInfo &FPI,
581 if (!FAM.getResult<DominatorTreeAnalysis>(F).verify(
582 DominatorTree::VerificationLevel::Full))
583 return false;
584 DominatorTree DT(F);
585 LoopInfo LI(DT);
586 auto Vocabulary = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F)
587 .getCachedResult<IR2VecVocabAnalysis>(*F.getParent());
588 auto Fresh =
590 return FPI == Fresh;
591}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const Function * getParent(const Value *V)
#define LLVM_ABI
Definition Compiler.h:213
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static cl::opt< unsigned > CallWithManyArgumentsThreshold("call-with-many-arguments-threshold", cl::Hidden, cl::init(4), cl::desc("The minimum number of arguments a function call must have before " "it is considered having many arguments."))
#define COUNT_OPERAND(OPTYPE)
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
Loop::LoopBounds::Direction Direction
Definition LoopInfo.cpp:231
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
uint64_t IntrinsicInst * II
FunctionAnalysisManager FAM
This file contains some templates that are useful if you are working with the STL at all.
This file implements a set that has insertion order iteration characteristics.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define LLVM_DEBUG(...)
Definition Debug.h:114
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
LLVM Basic Block Representation.
Definition BasicBlock.h:62
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
Definition BasicBlock.h:233
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
LLVM_ABI bool isIndirectCall() const
Return true if the callsite is an indirect call.
iterator_range< User::op_iterator > args()
Iteration adapter for range-for loops.
unsigned arg_size() const
Implements a dense probed hash-table based set.
Definition DenseSet.h:279
Analysis pass which computes a DominatorTree.
Definition Dominators.h:283
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:164
LLVM_ABI bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
LLVM_ABI FunctionPropertiesInfo run(Function &F, FunctionAnalysisManager &FAM)
int64_t BasicBlockCount
Number of basic blocks.
int64_t Uses
Number of uses of this function, plus 1 if the function is callable outside the module.
int64_t BlocksReachedFromConditionalInstruction
Number of blocks reached from a conditional instruction, or that are 'cases' of a SwitchInstr.
LLVM_ABI bool operator==(const FunctionPropertiesInfo &FPI) const
static LLVM_ABI FunctionPropertiesInfo getFunctionPropertiesInfo(const Function &F, const DominatorTree &DT, const LoopInfo &LI, const ir2vec::Vocabulary *Vocabulary)
LLVM_ABI void print(raw_ostream &OS) const
int64_t DirectCallsToDefinedFunctions
Number of direct calls made from this function to other functions defined in this module.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
LLVM_ABI FunctionPropertiesUpdater(FunctionPropertiesInfo &FPI, CallBase &CB)
LLVM_ABI void finish(FunctionAnalysisManager &FAM) const
LLVM_ABI unsigned getNumSuccessors() const LLVM_READONLY
Return the number of successors that this instruction has.
Analysis pass that exposes the LoopInfo for a function.
Definition LoopInfo.h:569
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition Analysis.h:118
A vector that has set insertion semantics.
Definition SetVector.h:57
size_type size() const
Determine the number of elements in the SetVector.
Definition SetVector.h:103
void insert_range(Range &&R)
Definition SetVector.h:176
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition SetVector.h:151
void insert_range(Range &&R)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
bool isVectorTy() const
True if this is an instance of VectorType.
Definition Type.h:273
bool isPointerTy() const
True if this is an instance of PointerType.
Definition Type.h:267
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
Definition Type.h:352
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
Definition Type.h:184
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition Type.h:240
Type * getType() const
All values are typed, get the type of this value.
Definition Value.h:256
iterator_range< user_iterator > users()
Definition Value.h:426
static LLVM_ABI std::unique_ptr< Embedder > create(IR2VecKind Mode, const Function &F, const Vocabulary &Vocab)
Factory method to create an Embedder object.
Definition IR2Vec.cpp:156
Class for storing and accessing the IR2Vec vocabulary.
Definition IR2Vec.h:242
LLVM_ABI unsigned getDimension() const
Definition IR2Vec.h:334
LLVM_ABI bool isValid() const
Definition IR2Vec.h:330
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
CallInst * Call
initializer< Ty > init(const Ty &Val)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition STLExtras.h:1667
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
auto successors(const MachineBasicBlock *BB)
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
LLVM_ABI cl::opt< bool > EnableDetailedFunctionProperties("enable-detailed-function-properties", cl::Hidden, cl::init(false), cl::desc("Whether or not to compute detailed function properties."))
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
Definition STLExtras.h:2184
auto pred_size(const MachineBasicBlock *BB)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:207
auto succ_size(const MachineBasicBlock *BB)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
static cl::opt< unsigned > BigBasicBlockInstructionThreshold("big-basic-block-instruction-threshold", cl::Hidden, cl::init(500), cl::desc("The minimum number of instructions a basic block should contain " "before being considered big."))
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1945
static cl::opt< unsigned > MediumBasicBlockInstructionThreshold("medium-basic-block-instruction-threshold", cl::Hidden, cl::init(15), cl::desc("The minimum number of instructions a basic block should contain " "before being considered medium-sized."))
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Embedding is a datatype that wraps std::vector<double>.
Definition IR2Vec.h:87