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"
18#include "llvm/IR/CFG.h"
19#include "llvm/IR/Constants.h"
20#include "llvm/IR/Dominators.h"
25#include <deque>
26
27using namespace llvm;
28
29namespace llvm {
31 "enable-detailed-function-properties", cl::Hidden, cl::init(false),
32 cl::desc("Whether or not to compute detailed function properties."));
33
35 "big-basic-block-instruction-threshold", cl::Hidden, cl::init(500),
36 cl::desc("The minimum number of instructions a basic block should contain "
37 "before being considered big."));
38
40 "medium-basic-block-instruction-threshold", cl::Hidden, cl::init(15),
41 cl::desc("The minimum number of instructions a basic block should contain "
42 "before being considered medium-sized."));
43} // namespace llvm
44
46 "call-with-many-arguments-threshold", cl::Hidden, cl::init(4),
47 cl::desc("The minimum number of arguments a function call must have before "
48 "it is considered having many arguments."));
49
50namespace {
51int64_t getNumBlocksFromCond(const BasicBlock &BB) {
52 int64_t Ret = 0;
53 if (const auto *BI = dyn_cast<BranchInst>(BB.getTerminator())) {
54 if (BI->isConditional())
55 Ret += BI->getNumSuccessors();
56 } else if (const auto *SI = dyn_cast<SwitchInst>(BB.getTerminator())) {
57 Ret += (SI->getNumCases() + (nullptr != SI->getDefaultDest()));
58 }
59 return Ret;
60}
61
62int64_t getUses(const Function &F) {
63 return ((!F.hasLocalLinkage()) ? 1 : 0) + F.getNumUses();
64}
65} // namespace
66
67void FunctionPropertiesInfo::reIncludeBB(const BasicBlock &BB) {
68 updateForBB(BB, +1);
69}
70
71void FunctionPropertiesInfo::updateForBB(const BasicBlock &BB,
72 int64_t Direction) {
73 assert(Direction == 1 || Direction == -1);
76 (Direction * getNumBlocksFromCond(BB));
77 for (const auto &I : BB) {
78 if (auto *CS = dyn_cast<CallBase>(&I)) {
79 const auto *Callee = CS->getCalledFunction();
80 if (Callee && !Callee->isIntrinsic() && !Callee->isDeclaration())
82 }
83 if (I.getOpcode() == Instruction::Load) {
85 } else if (I.getOpcode() == Instruction::Store) {
87 }
88 }
89 TotalInstructionCount += Direction * BB.sizeWithoutDebug();
90
92 unsigned SuccessorCount = succ_size(&BB);
93 if (SuccessorCount == 1)
95 else if (SuccessorCount == 2)
97 else if (SuccessorCount > 2)
99
100 unsigned PredecessorCount = pred_size(&BB);
101 if (PredecessorCount == 1)
103 else if (PredecessorCount == 2)
105 else if (PredecessorCount > 2)
107
112 else
114
115 // Calculate critical edges by looking through all successors of a basic
116 // block that has multiple successors and finding ones that have multiple
117 // predecessors, which represent critical edges.
118 if (SuccessorCount > 1) {
119 for (const auto *Successor : successors(&BB)) {
120 if (pred_size(Successor) > 1)
122 }
123 }
124
125 ControlFlowEdgeCount += Direction * SuccessorCount;
126
127 if (const auto *BI = dyn_cast<BranchInst>(BB.getTerminator())) {
128 if (!BI->isConditional())
130 }
131
132 for (const Instruction &I : BB.instructionsWithoutDebug()) {
133 if (I.isCast())
135
136 if (I.getType()->isFloatTy())
138 else if (I.getType()->isIntegerTy())
140
141 if (isa<IntrinsicInst>(I))
143
144 if (const auto *Call = dyn_cast<CallInst>(&I)) {
145 if (Call->isIndirectCall())
147 else
149
150 if (Call->getType()->isIntegerTy())
152 else if (Call->getType()->isFloatingPointTy())
154 else if (Call->getType()->isPointerTy())
156 else if (Call->getType()->isVectorTy()) {
157 if (Call->getType()->getScalarType()->isIntegerTy())
159 else if (Call->getType()->getScalarType()->isFloatingPointTy())
161 else if (Call->getType()->getScalarType()->isPointerTy())
163 }
164
165 if (Call->arg_size() > CallWithManyArgumentsThreshold)
167
168 for (const auto &Arg : Call->args()) {
169 if (Arg->getType()->isPointerTy()) {
171 break;
172 }
173 }
174 }
175
176#define COUNT_OPERAND(OPTYPE) \
177 if (isa<OPTYPE>(Operand)) { \
178 OPTYPE##OperandCount += Direction; \
179 continue; \
180 }
181
182 for (unsigned int OperandIndex = 0; OperandIndex < I.getNumOperands();
183 ++OperandIndex) {
184 Value *Operand = I.getOperand(OperandIndex);
193
194 // We only get to this point if we haven't matched any of the other
195 // operand types.
197 }
198
199#undef CHECK_OPERAND
200 }
201 }
202
203 if (IR2VecVocab) {
204 // We instantiate the IR2Vec embedder each time, as having an unique
205 // pointer to the embedder as member of the class would make it
206 // non-copyable. Instantiating the embedder in itself is not costly.
208 *BB.getParent(), *IR2VecVocab);
209 if (!Embedder) {
210 BB.getContext().emitError("Error creating IR2Vec embeddings");
211 return;
212 }
213 const auto &BBEmbedding = Embedder->getBBVector(BB);
214 // Subtract BBEmbedding from Function embedding if the direction is -1,
215 // and add it if the direction is +1.
216 if (Direction == -1)
217 FunctionEmbedding -= BBEmbedding;
218 else
219 FunctionEmbedding += BBEmbedding;
220 }
221}
222
223void FunctionPropertiesInfo::updateAggregateStats(const Function &F,
224 const LoopInfo &LI) {
225
226 Uses = getUses(F);
228 MaxLoopDepth = 0;
229 std::deque<const Loop *> Worklist;
230 llvm::append_range(Worklist, LI);
231 while (!Worklist.empty()) {
232 const auto *L = Worklist.front();
234 std::max(MaxLoopDepth, static_cast<int64_t>(L->getLoopDepth()));
235 Worklist.pop_front();
236 llvm::append_range(Worklist, L->getSubLoops());
237 }
238}
239
242 // We use the cached result of the IR2VecVocabAnalysis run by
243 // InlineAdvisorAnalysis. If the IR2VecVocabAnalysis is not run, we don't
244 // use IR2Vec embeddings.
246 .getCachedResult<IR2VecVocabAnalysis>(*F.getParent());
248 FAM.getResult<LoopAnalysis>(F), Vocabulary);
249}
250
252 const Function &F, const DominatorTree &DT, const LoopInfo &LI,
253 const ir2vec::Vocabulary *Vocabulary) {
254
256 if (Vocabulary && Vocabulary->isValid()) {
257 FPI.IR2VecVocab = Vocabulary;
258 FPI.FunctionEmbedding = ir2vec::Embedding(Vocabulary->getDimension(), 0.0);
259 }
260 for (const auto &BB : F)
261 if (DT.isReachableFromEntry(&BB))
262 FPI.reIncludeBB(BB);
263 FPI.updateAggregateStats(F, LI);
264 return FPI;
265}
266
268 const FunctionPropertiesInfo &FPI) const {
269 if (BasicBlockCount != FPI.BasicBlockCount ||
272 Uses != FPI.Uses ||
276 MaxLoopDepth != FPI.MaxLoopDepth ||
317 return false;
318 }
319 // Check the equality of the function embeddings. We don't check the equality
320 // of Vocabulary as it remains the same.
321 if (!FunctionEmbedding.approximatelyEquals(FPI.FunctionEmbedding))
322 return false;
323
324 return true;
325}
326
328#define PRINT_PROPERTY(PROP_NAME) OS << #PROP_NAME ": " << PROP_NAME << "\n";
329
339
376 }
377
378#undef PRINT_PROPERTY
379
380 OS << "\n";
381}
382
384
388}
389
392 OS << "Printing analysis results of CFA for function "
393 << "'" << F.getName() << "':"
394 << "\n";
396 return PreservedAnalyses::all();
397}
398
401 : FPI(FPI), CallSiteBB(*CB.getParent()), Caller(*CallSiteBB.getParent()) {
402 assert(isa<CallInst>(CB) || isa<InvokeInst>(CB));
403 // For BBs that are likely to change, we subtract from feature totals their
404 // contribution. Some features, like max loop counts or depths, are left
405 // invalid, as they will be updated post-inlining.
406 SmallPtrSet<const BasicBlock *, 4> LikelyToChangeBBs;
407 // The CB BB will change - it'll either be split or the callee's body (single
408 // BB) will be pasted in.
409 LikelyToChangeBBs.insert(&CallSiteBB);
410
411 // The caller's entry BB may change due to new alloca instructions.
412 LikelyToChangeBBs.insert(&*Caller.begin());
413
414 // The users of the value returned by call instruction can change
415 // leading to the change in embeddings being computed, when used.
416 // We conservatively add the BBs with such uses to LikelyToChangeBBs.
417 for (const auto *User : CB.users())
418 CallUsers.insert(dyn_cast<Instruction>(User)->getParent());
419 // CallSiteBB can be removed from CallUsers if present, it's taken care
420 // separately.
421 CallUsers.erase(&CallSiteBB);
422 LikelyToChangeBBs.insert_range(CallUsers);
423
424 // The successors may become unreachable in the case of `invoke` inlining.
425 // We track successors separately, too, because they form a boundary, together
426 // with the CB BB ('Entry') between which the inlined callee will be pasted.
427 Successors.insert_range(successors(&CallSiteBB));
428
429 // the outcome of the inlining may be that some edges get lost (DCEd BBs
430 // because inlining brought some constant, for example). We don't know which
431 // edges will be removed, so we list all of them as potentially removable.
432 // Some BBs have (at this point) duplicate edges. Remove duplicates, otherwise
433 // the DT updater will not apply changes correctly.
435 for (auto *Succ : successors(&CallSiteBB))
436 if (Inserted.insert(Succ).second)
437 DomTreeUpdates.emplace_back(DominatorTree::UpdateKind::Delete,
438 const_cast<BasicBlock *>(&CallSiteBB),
439 const_cast<BasicBlock *>(Succ));
440 // Reuse Inserted (which has some allocated capacity at this point) below, if
441 // we have an invoke.
442 Inserted.clear();
443 // Inlining only handles invoke and calls. If this is an invoke, and inlining
444 // it pulls another invoke, the original landing pad may get split, so as to
445 // share its content with other potential users. So the edge up to which we
446 // need to invalidate and then re-account BB data is the successors of the
447 // current landing pad. We can leave the current lp, too - if it doesn't get
448 // split, then it will be the place traversal stops. Either way, the
449 // discounted BBs will be checked if reachable and re-added.
450 if (const auto *II = dyn_cast<InvokeInst>(&CB)) {
451 const auto *UnwindDest = II->getUnwindDest();
452 Successors.insert_range(successors(UnwindDest));
453 // Same idea as above, we pretend we lose all these edges.
454 for (auto *Succ : successors(UnwindDest))
455 if (Inserted.insert(Succ).second)
456 DomTreeUpdates.emplace_back(DominatorTree::UpdateKind::Delete,
457 const_cast<BasicBlock *>(UnwindDest),
458 const_cast<BasicBlock *>(Succ));
459 }
460
461 // Exclude the CallSiteBB, if it happens to be its own successor (1-BB loop).
462 // We are only interested in BBs the graph moves past the callsite BB to
463 // define the frontier past which we don't want to re-process BBs. Including
464 // the callsite BB in this case would prematurely stop the traversal in
465 // finish().
466 Successors.erase(&CallSiteBB);
467
468 LikelyToChangeBBs.insert_range(Successors);
469
470 // Commit the change. While some of the BBs accounted for above may play dual
471 // role - e.g. caller's entry BB may be the same as the callsite BB - set
472 // insertion semantics make sure we account them once. This needs to be
473 // followed in `finish`, too.
474 for (const auto *BB : LikelyToChangeBBs)
475 FPI.updateForBB(*BB, -1);
476}
477
478DominatorTree &FunctionPropertiesUpdater::getUpdatedDominatorTree(
480 auto &DT =
481 FAM.getResult<DominatorTreeAnalysis>(const_cast<Function &>(Caller));
482
484
486 for (auto *Succ : successors(&CallSiteBB))
487 if (Inserted.insert(Succ).second)
488 FinalDomTreeUpdates.push_back({DominatorTree::UpdateKind::Insert,
489 const_cast<BasicBlock *>(&CallSiteBB),
490 const_cast<BasicBlock *>(Succ)});
491
492 // Perform the deletes last, so that any new nodes connected to nodes
493 // participating in the edge deletion are known to the DT.
494 for (auto &Upd : DomTreeUpdates)
495 if (!llvm::is_contained(successors(Upd.getFrom()), Upd.getTo()))
496 FinalDomTreeUpdates.push_back(Upd);
497
498 DT.applyUpdates(FinalDomTreeUpdates);
499#ifdef EXPENSIVE_CHECKS
500 assert(DT.verify(DominatorTree::VerificationLevel::Full));
501#endif
502 return DT;
503}
504
506 // Update feature values from the BBs that were copied from the callee, or
507 // might have been modified because of inlining. The latter have been
508 // subtracted in the FunctionPropertiesUpdater ctor.
509 // There could be successors that were reached before but now are only
510 // reachable from elsewhere in the CFG.
511 // One example is the following diamond CFG (lines are arrows pointing down):
512 // A
513 // / \
514 // B C
515 // | |
516 // | D
517 // | |
518 // | E
519 // \ /
520 // F
521 // There's a call site in C that is inlined. Upon doing that, it turns out
522 // it expands to
523 // call void @llvm.trap()
524 // unreachable
525 // F isn't reachable from C anymore, but we did discount it when we set up
526 // FunctionPropertiesUpdater, so we need to re-include it here.
527 // At the same time, D and E were reachable before, but now are not anymore,
528 // so we need to leave D out (we discounted it at setup), and explicitly
529 // remove E.
532 auto &DT = getUpdatedDominatorTree(FAM);
533
534 if (&CallSiteBB != &*Caller.begin())
535 Reinclude.insert(&*Caller.begin());
536
537 // Reinclude the BBs which use the values returned by call instruction
538 Reinclude.insert_range(CallUsers);
539
540 // Distribute the successors to the 2 buckets.
541 for (const auto *Succ : Successors)
542 if (DT.isReachableFromEntry(Succ))
543 Reinclude.insert(Succ);
544 else
545 Unreachable.insert(Succ);
546
547 // For reinclusion, we want to stop at the reachable successors, who are at
548 // the beginning of the worklist; but, starting from the callsite bb and
549 // ending at those successors, we also want to perform a traversal.
550 // IncludeSuccessorsMark is the index after which we include successors.
551 const auto IncludeSuccessorsMark = Reinclude.size();
552 bool CSInsertion = Reinclude.insert(&CallSiteBB);
553 (void)CSInsertion;
554 assert(CSInsertion);
555 for (size_t I = 0; I < Reinclude.size(); ++I) {
556 const auto *BB = Reinclude[I];
557 FPI.reIncludeBB(*BB);
558 if (I >= IncludeSuccessorsMark)
559 Reinclude.insert_range(successors(BB));
560 }
561
562 // For exclusion, we don't need to exclude the set of BBs that were successors
563 // before and are now unreachable, because we already did that at setup. For
564 // the rest, as long as a successor is unreachable, we want to explicitly
565 // exclude it.
566 const auto AlreadyExcludedMark = Unreachable.size();
567 for (size_t I = 0; I < Unreachable.size(); ++I) {
568 const auto *U = Unreachable[I];
569 if (I >= AlreadyExcludedMark)
570 FPI.updateForBB(*U, -1);
571 for (const auto *Succ : successors(U))
572 if (!DT.isReachableFromEntry(Succ))
573 Unreachable.insert(Succ);
574 }
575
576 const auto &LI = FAM.getResult<LoopAnalysis>(const_cast<Function &>(Caller));
577 FPI.updateAggregateStats(Caller, LI);
578#ifdef EXPENSIVE_CHECKS
579 assert(isUpdateValid(Caller, FPI, FAM));
580#endif
581}
582
583bool FunctionPropertiesUpdater::isUpdateValid(Function &F,
584 const FunctionPropertiesInfo &FPI,
586 if (!FAM.getResult<DominatorTreeAnalysis>(F).verify(
587 DominatorTree::VerificationLevel::Full))
588 return false;
589 DominatorTree DT(F);
590 LoopInfo LI(DT);
592 .getCachedResult<IR2VecVocabAnalysis>(*F.getParent());
593 auto Fresh =
595 return FPI == Fresh;
596}
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...
#define PRINT_PROPERTY(PROP_NAME)
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...
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
uint64_t IntrinsicInst * II
FunctionAnalysisManager FAM
This file contains some templates that are useful if you are working with the STL at all.
raw_pwrite_stream & OS
This file implements a set that has insertion order iteration characteristics.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Definition: PassManager.h:412
This class represents an incoming formal argument to a Function.
Definition: Argument.h:32
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...
Definition: InstrTypes.h:1116
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:277
This is the shared class of boolean and integer constants.
Definition: Constants.h:87
This is an important base class in LLVM.
Definition: Constant.h:43
Implements a dense probed hash-table based set.
Definition: DenseSet.h:263
Analysis pass which computes a DominatorTree.
Definition: Dominators.h:284
bool verify(VerificationLevel VL=VerificationLevel::Full) const
verify - checks if the tree is correct.
void applyUpdates(ArrayRef< UpdateType > Updates)
Inform the dominator tree about a sequence of CFG edge insertions and deletions and perform a batch u...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:165
LLVM_ABI bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
Definition: Dominators.cpp:334
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
iterator begin()
Definition: Function.h:851
Analysis pass that exposes the LoopInfo for a function.
Definition: LoopInfo.h:570
An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR uni...
Definition: PassManager.h:716
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:59
size_type size() const
Determine the number of elements in the SetVector.
Definition: SetVector.h:104
void insert_range(Range &&R)
Definition: SetVector.h:193
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition: SetVector.h:168
void insert_range(Range &&R)
Definition: SmallPtrSet.h:490
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:401
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:541
reference emplace_back(ArgTypes &&... Args)
Definition: SmallVector.h:938
void push_back(const T &Elt)
Definition: SmallVector.h:414
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1197
LLVM Value Representation.
Definition: Value.h:75
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:160
Class for storing and accessing the IR2Vec vocabulary.
Definition: IR2Vec.h:157
LLVM_ABI bool isValid() const
Definition: IR2Vec.cpp:266
LLVM_ABI unsigned getDimension() const
Definition: IR2Vec.cpp:270
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:444
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:1702
auto successors(const MachineBasicBlock *BB)
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:2155
auto pred_size(const MachineBasicBlock *BB)
auto succ_size(const MachineBasicBlock *BB)
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:1916
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."))
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:29
Direction
An enum for the direction of the loop.
Definition: LoopInfo.h:217
Embedding is a datatype that wraps std::vector<double>.
Definition: IR2Vec.h:79
LLVM_ABI bool approximatelyEquals(const Embedding &RHS, double Tolerance=1e-4) const
Returns true if the embedding is approximately equal to the RHS embedding within the specified tolera...
Definition: IR2Vec.cpp:131