LLVM 24.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 "AnalysisOptions.h"
16#include "llvm/ADT/STLExtras.h"
17#include "llvm/ADT/SetVector.h"
18#include "llvm/ADT/Statistic.h"
20#include "llvm/IR/CFG.h"
21#include "llvm/IR/Constants.h"
22#include "llvm/IR/Dominators.h"
25#include <deque>
26
27using namespace llvm;
28
29#define DEBUG_TYPE "func-properties-stats"
30
31#define FUNCTION_PROPERTY(Name, Description) \
32 STATISTIC(Num##Name, Description); \
33 STATISTIC(Num##Name##PreOptimization, Description " (before " \
34 "optimizations)");
35#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
36 STATISTIC(Num##Name, Description); \
37 STATISTIC(Num##Name##PreOptimization, Description " (before " \
38 "optimizations)");
39#include "llvm/IR/FunctionProperties.def"
40
41namespace {
42int64_t getNumBlocksFromCond(const BasicBlock &BB) {
43 int64_t Ret = 0;
44 if (const auto *BI = dyn_cast<CondBrInst>(BB.getTerminator())) {
45 Ret += BI->getNumSuccessors();
46 } else if (const auto *SI = dyn_cast<SwitchInst>(BB.getTerminator())) {
47 Ret += (SI->getNumCases() + (nullptr != SI->getDefaultDest()));
48 }
49 return Ret;
50}
51
52int64_t getUses(const Function &F) {
53 return ((!F.hasLocalLinkage()) ? 1 : 0) + F.getNumUses();
54}
55} // namespace
56
57void FunctionPropertiesInfo::reIncludeBB(const BasicBlock &BB) {
58 updateForBB(BB, +1);
59}
60
61void FunctionPropertiesInfo::updateForBB(const BasicBlock &BB,
62 int64_t Direction) {
63 assert(Direction == 1 || Direction == -1);
66 (Direction * getNumBlocksFromCond(BB));
67 for (const auto &I : BB) {
68 if (auto *CS = dyn_cast<CallBase>(&I)) {
69 const auto *Callee = CS->getCalledFunction();
70 if (Callee && !Callee->isIntrinsic() && !Callee->isDeclaration())
72 }
73 if (I.getOpcode() == Instruction::Load) {
75 } else if (I.getOpcode() == Instruction::Store) {
77 }
78 }
79 TotalInstructionCount += Direction * BB.size();
80
81 if (DetailedOpts) {
82 const AnalysisOptions &Opts = *DetailedOpts;
83 unsigned SuccessorCount = succ_size(&BB);
84 if (SuccessorCount == 1)
86 else if (SuccessorCount == 2)
88 else if (SuccessorCount > 2)
90
91 if (BB.hasNPredecessors(1))
93 else if (BB.hasNPredecessors(2))
95 else if (BB.hasNPredecessorsOrMore(3))
97
98 if (TotalInstructionCount > Opts.big_basic_block_instruction_threshold)
100 else if (TotalInstructionCount >
101 Opts.medium_basic_block_instruction_threshold)
103 else
105
106 // Calculate critical edges by looking through all successors of a basic
107 // block that has multiple successors and finding ones that have multiple
108 // predecessors, which represent critical edges.
109 if (SuccessorCount > 1) {
110 for (const auto *Successor : successors(&BB)) {
111 if (Successor->hasNPredecessorsOrMore(2))
113 }
114 }
115
116 ControlFlowEdgeCount += Direction * SuccessorCount;
117
118 const Instruction *TI = BB.getTerminator();
119 if (isa<UncondBrInst>(TI)) {
123 } else if (isa<CondBrInst>(TI)) {
127 } else if (const auto *SI = dyn_cast<SwitchInst>(TI)) {
129 SwitchSuccessorCount += Direction * SI->getNumSuccessors();
130 }
131
132 for (const Instruction &I : BB) {
133 if (I.isCast())
135
136 if (I.getType()->isFloatTy())
138 else if (I.getType()->isIntegerTy())
140
143
144 if (const auto *Call = dyn_cast<CallInst>(&I)) {
145 if (Call->doesNotReturn())
147
148 if (Call->isIndirectCall())
150 else
152
153 if (Call->getType()->isIntegerTy())
155 else if (Call->getType()->isFloatingPointTy())
157 else if (Call->getType()->isPointerTy())
159 else if (Call->getType()->isVectorTy()) {
164 else if (Call->getType()->getScalarType()->isPointerTy())
166 }
167
168 if (Call->arg_size() > Opts.call_with_many_arguments_threshold)
170
171 for (const auto &Arg : Call->args()) {
172 if (Arg->getType()->isPointerTy()) {
174 break;
175 }
176 }
177 }
178
179#define COUNT_OPERAND(OPTYPE) \
180 if (isa<OPTYPE>(Operand)) { \
181 OPTYPE##OperandCount += Direction; \
182 continue; \
183 }
184
185 for (unsigned int OperandIndex = 0; OperandIndex < I.getNumOperands();
186 ++OperandIndex) {
187 Value *Operand = I.getOperand(OperandIndex);
188 COUNT_OPERAND(GlobalValue)
189 COUNT_OPERAND(ConstantInt)
190 COUNT_OPERAND(ConstantFP)
191 COUNT_OPERAND(Constant)
192 COUNT_OPERAND(Instruction)
193 COUNT_OPERAND(BasicBlock)
194 COUNT_OPERAND(InlineAsm)
195 COUNT_OPERAND(Argument)
196
197 // We only get to this point if we haven't matched any of the other
198 // operand types.
200 }
201
202#undef CHECK_OPERAND
203 }
204 }
205
206 if (IR2VecVocab) {
207 // We instantiate the IR2Vec embedder each time, as having an unique
208 // pointer to the embedder as member of the class would make it
209 // non-copyable. Instantiating the embedder in itself is not costly.
211 *BB.getParent(), *IR2VecVocab);
212 if (!Embedder) {
213 BB.getContext().emitError("Error creating IR2Vec embeddings");
214 return;
215 }
216 const auto &BBEmbedding = Embedder->getBBVector(BB);
217 // Subtract BBEmbedding from Function embedding if the direction is -1,
218 // and add it if the direction is +1.
219 if (Direction == -1)
220 FunctionEmbedding -= BBEmbedding;
221 else
222 FunctionEmbedding += BBEmbedding;
223 }
224}
225
226void FunctionPropertiesInfo::updateAggregateStats(const Function &F,
227 const LoopInfo &LI) {
228
229 Uses = getUses(F);
231 MaxLoopDepth = 0;
232 std::deque<const Loop *> Worklist;
233 llvm::append_range(Worklist, LI);
234 while (!Worklist.empty()) {
235 const auto *L = Worklist.front();
237 std::max(MaxLoopDepth, static_cast<int64_t>(L->getLoopDepth()));
238 Worklist.pop_front();
239 llvm::append_range(Worklist, L->getSubLoops());
240 }
241}
242
245 // We use the cached result of the IR2VecVocabAnalysis run by
246 // InlineAdvisorAnalysis. If the IR2VecVocabAnalysis is not run, we don't
247 // use IR2Vec embeddings.
248 auto Vocabulary = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F)
249 .getCachedResult<IR2VecVocabAnalysis>(*F.getParent());
251 FAM.getResult<LoopAnalysis>(F), Vocabulary);
252}
253
255 const Function &F, const DominatorTree &DT, const LoopInfo &LI,
256 const ir2vec::Vocabulary *Vocabulary) {
257
259 const AnalysisOptions &Opts = getAnalysisOptions(F);
260 if (Opts.enable_detailed_function_properties)
261 FPI.DetailedOpts = &Opts;
262 if (Vocabulary && Vocabulary->isValid()) {
263 FPI.IR2VecVocab = Vocabulary;
264 FPI.FunctionEmbedding = ir2vec::Embedding(Vocabulary->getDimension(), 0.0);
265 }
266 for (const auto &BB : F)
267 if (DT.isReachableFromEntry(&BB))
268 FPI.reIncludeBB(BB);
269 FPI.updateAggregateStats(F, LI);
270 return FPI;
271}
272
274 const FunctionPropertiesInfo &FPI) const {
275 if (BasicBlockCount != FPI.BasicBlockCount ||
278 Uses != FPI.Uses ||
282 MaxLoopDepth != FPI.MaxLoopDepth ||
324 return false;
325 }
326 // Check the equality of the function embeddings. We don't check the equality
327 // of Vocabulary as it remains the same.
328 if (!FunctionEmbedding.approximatelyEquals(FPI.FunctionEmbedding))
329 return false;
330
331 return true;
332}
333
335#define FUNCTION_PROPERTY(Name, Description) OS << #Name ": " << Name << "\n";
336
337#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
338 if (DetailedOpts) { \
339 OS << #Name ": " << Name << "\n"; \
340 }
341
342#include "llvm/IR/FunctionProperties.def"
343
344#undef FUNCTION_PROPERTY
345#undef DETAILED_FUNCTION_PROPERTY
346
347 OS << "\n";
348}
349
351
356
359 OS << "Printing analysis results of CFA for function "
360 << "'" << F.getName() << "':"
361 << "\n";
363 return PreservedAnalyses::all();
364}
365
369 LLVM_DEBUG(dbgs() << "STATSCOUNT: running on function " << F.getName()
370 << "\n");
371 auto &AnalysisResults = FAM.getResult<FunctionPropertiesAnalysis>(F);
372 if (IsPreOptimization) {
373#define FUNCTION_PROPERTY(Name, Description) \
374 Num##Name##PreOptimization += AnalysisResults.Name;
375#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
376 Num##Name##PreOptimization += AnalysisResults.Name;
377#include "llvm/IR/FunctionProperties.def"
378#undef FUNCTION_PROPERTY
379#undef DETAILED_FUNCTION_PROPERTY
380 } else {
381#define FUNCTION_PROPERTY(Name, Description) Num##Name += AnalysisResults.Name;
382#define DETAILED_FUNCTION_PROPERTY(Name, Description) \
383 Num##Name += AnalysisResults.Name;
384#include "llvm/IR/FunctionProperties.def"
385#undef FUNCTION_PROPERTY
386#undef DETAILED_FUNCTION_PROPERTY
387 }
388 return PreservedAnalyses::all();
389}
390
393 : FPI(FPI), CallSiteBB(*CB.getParent()), Caller(*CallSiteBB.getParent()) {
395 // For BBs that are likely to change, we subtract from feature totals their
396 // contribution. Some features, like max loop counts or depths, are left
397 // invalid, as they will be updated post-inlining.
398 SmallPtrSet<const BasicBlock *, 4> LikelyToChangeBBs;
399 // The CB BB will change - it'll either be split or the callee's body (single
400 // BB) will be pasted in.
401 LikelyToChangeBBs.insert(&CallSiteBB);
402
403 // The caller's entry BB may change due to new alloca instructions.
404 LikelyToChangeBBs.insert(&*Caller.begin());
405
406 // The users of the value returned by call instruction can change
407 // leading to the change in embeddings being computed, when used.
408 // We conservatively add the BBs with such uses to LikelyToChangeBBs.
409 for (const auto *User : CB.users())
410 CallUsers.insert(dyn_cast<Instruction>(User)->getParent());
411 // CallSiteBB can be removed from CallUsers if present, it's taken care
412 // separately.
413 CallUsers.erase(&CallSiteBB);
414 LikelyToChangeBBs.insert_range(CallUsers);
415
416 // The successors may become unreachable in the case of `invoke` inlining.
417 // We track successors separately, too, because they form a boundary, together
418 // with the CB BB ('Entry') between which the inlined callee will be pasted.
419 Successors.insert_range(successors(&CallSiteBB));
420
421 // the outcome of the inlining may be that some edges get lost (DCEd BBs
422 // because inlining brought some constant, for example). We don't know which
423 // edges will be removed, so we list all of them as potentially removable.
424 // Some BBs have (at this point) duplicate edges. Remove duplicates, otherwise
425 // the DT updater will not apply changes correctly.
427 for (auto *Succ : successors(&CallSiteBB))
428 if (Inserted.insert(Succ).second)
429 DomTreeUpdates.emplace_back(DominatorTree::UpdateKind::Delete,
430 const_cast<BasicBlock *>(&CallSiteBB),
431 const_cast<BasicBlock *>(Succ));
432 // Reuse Inserted (which has some allocated capacity at this point) below, if
433 // we have an invoke.
434 Inserted.clear();
435 // Inlining only handles invoke and calls. If this is an invoke, and inlining
436 // it pulls another invoke, the original landing pad may get split, so as to
437 // share its content with other potential users. So the edge up to which we
438 // need to invalidate and then re-account BB data is the successors of the
439 // current landing pad. We can leave the current lp, too - if it doesn't get
440 // split, then it will be the place traversal stops. Either way, the
441 // discounted BBs will be checked if reachable and re-added.
442 if (const auto *II = dyn_cast<InvokeInst>(&CB)) {
443 const auto *UnwindDest = II->getUnwindDest();
444 Successors.insert_range(successors(UnwindDest));
445 // Same idea as above, we pretend we lose all these edges.
446 for (auto *Succ : successors(UnwindDest))
447 if (Inserted.insert(Succ).second)
448 DomTreeUpdates.emplace_back(DominatorTree::UpdateKind::Delete,
449 const_cast<BasicBlock *>(UnwindDest),
450 const_cast<BasicBlock *>(Succ));
451 }
452
453 // Exclude the CallSiteBB, if it happens to be its own successor (1-BB loop).
454 // We are only interested in BBs the graph moves past the callsite BB to
455 // define the frontier past which we don't want to re-process BBs. Including
456 // the callsite BB in this case would prematurely stop the traversal in
457 // finish().
458 Successors.erase(&CallSiteBB);
459
460 LikelyToChangeBBs.insert_range(Successors);
461
462 // Commit the change. While some of the BBs accounted for above may play dual
463 // role - e.g. caller's entry BB may be the same as the callsite BB - set
464 // insertion semantics make sure we account them once. This needs to be
465 // followed in `finish`, too.
466 for (const auto *BB : LikelyToChangeBBs)
467 FPI.updateForBB(*BB, -1);
468}
469
470DominatorTree &FunctionPropertiesUpdater::getUpdatedDominatorTree(
472 auto &DT =
473 FAM.getResult<DominatorTreeAnalysis>(const_cast<Function &>(Caller));
474
476
478 for (auto *Succ : successors(&CallSiteBB))
479 if (Inserted.insert(Succ).second)
480 FinalDomTreeUpdates.push_back({DominatorTree::UpdateKind::Insert,
481 const_cast<BasicBlock *>(&CallSiteBB),
482 const_cast<BasicBlock *>(Succ)});
483
484 // Perform the deletes last, so that any new nodes connected to nodes
485 // participating in the edge deletion are known to the DT.
486 for (auto &Upd : DomTreeUpdates)
487 if (!llvm::is_contained(successors(Upd.getFrom()), Upd.getTo()))
488 FinalDomTreeUpdates.push_back(Upd);
489
490 DT.applyUpdates(FinalDomTreeUpdates);
491#ifdef EXPENSIVE_CHECKS
492 assert(DT.verify(DominatorTree::VerificationLevel::Full));
493#endif
494 return DT;
495}
496
498 // Update feature values from the BBs that were copied from the callee, or
499 // might have been modified because of inlining. The latter have been
500 // subtracted in the FunctionPropertiesUpdater ctor.
501 // There could be successors that were reached before but now are only
502 // reachable from elsewhere in the CFG.
503 // One example is the following diamond CFG (lines are arrows pointing down):
504 // A
505 // / \
506 // B C
507 // | |
508 // | D
509 // | |
510 // | E
511 // \ /
512 // F
513 // There's a call site in C that is inlined. Upon doing that, it turns out
514 // it expands to
515 // call void @llvm.trap()
516 // unreachable
517 // F isn't reachable from C anymore, but we did discount it when we set up
518 // FunctionPropertiesUpdater, so we need to re-include it here.
519 // At the same time, D and E were reachable before, but now are not anymore,
520 // so we need to leave D out (we discounted it at setup), and explicitly
521 // remove E.
524 auto &DT = getUpdatedDominatorTree(FAM);
525
526 if (&CallSiteBB != &*Caller.begin())
527 Reinclude.insert(&*Caller.begin());
528
529 // Reinclude the BBs which use the values returned by call instruction
530 Reinclude.insert_range(CallUsers);
531
532 // Distribute the successors to the 2 buckets.
533 for (const auto *Succ : Successors)
534 if (DT.isReachableFromEntry(Succ))
535 Reinclude.insert(Succ);
536 else
537 Unreachable.insert(Succ);
538
539 // For reinclusion, we want to stop at the reachable successors, who are at
540 // the beginning of the worklist; but, starting from the callsite bb and
541 // ending at those successors, we also want to perform a traversal.
542 // IncludeSuccessorsMark is the index after which we include successors.
543 const auto IncludeSuccessorsMark = Reinclude.size();
544 bool CSInsertion = Reinclude.insert(&CallSiteBB);
545 (void)CSInsertion;
546 assert(CSInsertion);
547 for (size_t I = 0; I < Reinclude.size(); ++I) {
548 const auto *BB = Reinclude[I];
549 FPI.reIncludeBB(*BB);
550 if (I >= IncludeSuccessorsMark)
551 Reinclude.insert_range(successors(BB));
552 }
553
554 // For exclusion, we don't need to exclude the set of BBs that were successors
555 // before and are now unreachable, because we already did that at setup. For
556 // the rest, as long as a successor is unreachable, we want to explicitly
557 // exclude it.
558 const auto AlreadyExcludedMark = Unreachable.size();
559 for (size_t I = 0; I < Unreachable.size(); ++I) {
560 const auto *U = Unreachable[I];
561 if (I >= AlreadyExcludedMark)
562 FPI.updateForBB(*U, -1);
563 for (const auto *Succ : successors(U))
564 if (!DT.isReachableFromEntry(Succ))
565 Unreachable.insert(Succ);
566 }
567
568 const auto &LI = FAM.getResult<LoopAnalysis>(const_cast<Function &>(Caller));
569 FPI.updateAggregateStats(Caller, LI);
570#ifdef EXPENSIVE_CHECKS
571 assert(isUpdateValid(Caller, FPI, FAM));
572#endif
573}
574
575bool FunctionPropertiesUpdater::isUpdateValid(Function &F,
576 const FunctionPropertiesInfo &FPI,
578 if (!FAM.getResult<DominatorTreeAnalysis>(F).verify(
579 DominatorTree::VerificationLevel::Full))
580 return false;
581 DominatorTree DT(F);
582 LoopInfo LI(DT);
583 auto Vocabulary = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F)
584 .getCachedResult<IR2VecVocabAnalysis>(*F.getParent());
585 auto Fresh =
587 return FPI == Fresh;
588}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const Function * getParent(const Value *V)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
#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:254
#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:119
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; assumes that the block is well-formed.
Definition BasicBlock.h:237
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.
bool doesNotReturn() const
Determine if the call cannot return.
unsigned arg_size() const
Implements a dense probed hash-table based set.
Definition DenseSet.h:281
Analysis pass which computes a DominatorTree.
Definition Dominators.h:241
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:122
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 PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
LLVM_ABI FunctionPropertiesUpdater(FunctionPropertiesInfo &FPI, CallBase &CB)
LLVM_ABI void finish(FunctionAnalysisManager &FAM) const
iterator_range< user_iterator > users()
Analysis pass that exposes the LoopInfo for a function.
Definition LoopInfo.h:594
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:182
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition SetVector.h:157
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:283
bool isPointerTy() const
True if this is an instance of PointerType.
Definition Type.h:277
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
Definition Type.h:363
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
Definition Type.h:186
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition Type.h:252
Type * getType() const
All values are typed, get the type of this value.
Definition Value.h:257
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:134
Class for storing and accessing the IR2Vec vocabulary.
Definition IR2Vec.h:245
unsigned getDimension() const
Definition IR2Vec.h:346
bool isValid() const
Definition IR2Vec.h:344
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
CallInst * Call
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
This is an optimization pass for GlobalISel generic memory operations.
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:1685
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.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
Definition STLExtras.h:2224
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143
const AnalysisOptions & getAnalysisOptions(const LLVMContext &C)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:209
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
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1963
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
Embedding is a datatype that wraps std::vector<double>.
Definition IR2Vec.h:85