Go to the documentation of this file.
14 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
15 #define LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
56 enum { FollowRAUW =
false };
74 std::tie(MapIter, Inserted) = GlobalNumbers.
insert({Global, NextNumber});
81 GlobalNumbers.
erase(Global);
85 GlobalNumbers.
clear();
97 :
FnL(F1),
FnR(F2), GlobalNumbers(GN) {}
278 bool &needToCmpOperands)
const;
335 int cmpRangeMetadata(
const MDNode *L,
const MDNode *R)
const;
336 int cmpOperandBundlesSchema(
const CallBase &LCS,
const CallBase &RCS)
const;
349 return cmpGEPs(cast<GEPOperator>(GEPL), cast<GEPOperator>(GEPR));
393 #endif // LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
GlobalNumberState assigns an integer to each global value in the program, which is used by the compar...
This is an optimization pass for GlobalISel generic memory operations.
int cmpValues(const Value *L, const Value *R) const
Assign or look up previously assigned numbers for the two values, and return whether the numbers are ...
int cmpBasicBlocks(const BasicBlock *BBL, const BasicBlock *BBR) const
Test whether two basic blocks have equivalent behaviour.
int compareSignature() const
Compares the signature and other general attributes of the two functions.
The instances of the Type class are immutable: once they are created, they are never changed.
void beginCompare()
Start the comparison.
GlobalNumberState()=default
int cmpConstants(const Constant *L, const Constant *R) const
Constants comparison.
LLVM Basic Block Representation.
static FunctionHash functionHash(Function &)
int cmpMem(StringRef L, StringRef R) const
int cmpAPInts(const APInt &L, const APInt &R) const
This struct is a compact representation of a valid (non-zero power of two) alignment.
This class defines the default behavior for configurable aspects of ValueMap<>.
AtomicOrdering
Atomic ordering for LLVM's memory model.
int compare()
Test whether the two functions have equivalent behaviour.
This is an important base class in LLVM.
bool erase(const KeyT &Val)
int cmpAligns(Align L, Align R) const
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
int cmpAPFloats(const APFloat &L, const APFloat &R) const
@ BasicBlock
Various leaf nodes.
Class for arbitrary precision integers.
uint64_t getNumber(GlobalValue *Global)
StringRef - Represent a constant reference to a string, i.e.
int cmpOperations(const Instruction *L, const Instruction *R, bool &needToCmpOperands) const
Compare two Instructions for equivalence, similar to Instruction::isSameOperationAs.
int cmpTypes(Type *TyL, Type *TyR) const
cmpType - compares two types, defines total ordering among the types set.
void erase(GlobalValue *Global)
int cmpNumbers(uint64_t L, uint64_t R) const
FunctionComparator - Compares two functions to determine whether or not they will generate machine co...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
FunctionComparator(const Function *F1, const Function *F2, GlobalNumberState *GN)
LLVM Value Representation.
int cmpGlobalValues(GlobalValue *L, GlobalValue *R) const
Compares two global values by number.