14 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H 15 #define LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H 56 enum { FollowRAUW =
false };
66 uint64_t NextNumber = 0;
74 std::tie(MapIter, Inserted) = GlobalNumbers.
insert({Global, NextNumber});
81 GlobalNumbers.
erase(Global);
85 GlobalNumbers.
clear();
97 : FnL(F1), FnR(F2), GlobalNumbers(GN) {}
115 int compareSignature()
const;
246 int cmpValues(
const Value *L,
const Value *R)
const;
278 bool &needToCmpOperands)
const;
320 int cmpTypes(
Type *TyL,
Type *TyR)
const;
322 int cmpNumbers(uint64_t L, uint64_t R)
const;
323 int cmpAPInts(
const APInt &L,
const APInt &R)
const;
334 int cmpRangeMetadata(
const MDNode *L,
const MDNode *R)
const;
348 return cmpGEPs(cast<GEPOperator>(GEPL), cast<GEPOperator>(GEPR));
392 #endif // LLVM_TRANSFORMS_UTILS_FUNCTIONCOMPARATOR_H
Atomic ordering constants.
This class represents lattice values for constants.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
This class defines the default behavior for configurable aspects of ValueMap<>.
uint64_t FunctionHash
Hash a function.
FunctionComparator(const Function *F1, const Function *F2, GlobalNumberState *GN)
This file contains the simple types necessary to represent the attributes associated with functions a...
AtomicOrdering
Atomic ordering for LLVM's memory model.
void beginCompare()
Start the comparison.
uint64_t getNumber(GlobalValue *Global)
void erase(GlobalValue *Global)
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.
GlobalNumberState assigns an integer to each global value in the program, which is used by the compar...
Class for arbitrary precision integers.
int compare(DigitsT LDigits, int16_t LScale, DigitsT RDigits, int16_t RScale)
Compare two scaled numbers.
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
GlobalNumberState()=default
bool erase(const KeyT &Val)