15 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
16 #define LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
31 class GetElementPtrInst;
47 enum { FollowRAUW =
false };
55 uint64_t NextNumber = 0;
63 std::tie(MapIter, Inserted) = GlobalNumbers.
insert({Global, NextNumber});
70 GlobalNumbers.
clear();
82 :
FnL(F1),
FnR(F2), GlobalNumbers(GN) {}
262 bool &needToCmpOperands)
const;
318 int cmpRangeMetadata(
const MDNode *
L,
const MDNode *R)
const;
332 return cmpGEPs(cast<GEPOperator>(GEPL), cast<GEPOperator>(GEPR));
376 #endif // LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
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 ...
Atomic ordering constants.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
This class defines the default behavior for configurable aspects of ValueMap<>.
int cmpAPInts(const APInt &L, const APInt &R) const
int cmpOperations(const Instruction *L, const Instruction *R, bool &needToCmpOperands) const
Compare two Instructions for equivalence, similar to Instruction::isSameOperationAs.
int cmpGlobalValues(GlobalValue *L, GlobalValue *R) const
Compares two global values by number.
FunctionComparator(const Function *F1, const Function *F2, GlobalNumberState *GN)
AtomicOrdering
Atomic ordering for LLVM's memory model.
void beginCompare()
Start the comparison.
uint64_t getNumber(GlobalValue *Global)
static FunctionHash functionHash(Function &)
an instruction for type-safe pointer arithmetic to access elements of arrays and structs ...
FunctionComparator - Compares two functions to determine whether or not they will generate machine co...
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
This file declares a class to represent arbitrary precision floating point values and provide a varie...
int cmpNumbers(uint64_t L, uint64_t R) const
int cmpMem(StringRef L, StringRef R) const
uint64_t FunctionHash
Hash a function.
int compareSignature() const
Compares the signature and other general attributes of the two functions.
int cmpTypes(Type *TyL, Type *TyR) const
cmpType - compares two types, defines total ordering among the types set.
GlobalNumberState assigns an integer to each global value in the program, which is used by the compar...
Class for arbitrary precision integers.
int compare()
Test whether the two functions have equivalent behaviour.
int cmpConstants(const Constant *L, const Constant *R) const
Constants comparison.
int cmpBasicBlocks(const BasicBlock *BBL, const BasicBlock *BBR) const
Test whether two basic blocks have equivalent behaviour.
LLVM Value Representation.
int cmpAPFloats(const APFloat &L, const APFloat &R) const
StringRef - Represent a constant reference to a string, i.e.
GlobalNumberState()=default