Go to the documentation of this file.
32 ModuleHasher(
Module &M) : TheModule(
M) {}
41 for (
auto &
F : TheModule) {
42 if (
F.isDeclaration() ||
F.hasLocalLinkage() || !
F.hasName())
44 auto Name =
F.getName();
47 for (
auto &GV : TheModule.globals()) {
48 if (GV.isDeclaration() || GV.hasLocalLinkage() || !GV.hasName())
50 auto Name = GV.getName();
59 TheHash = std::string(
Result.str());
76 for (
auto &GO :
M.global_objects())
78 for (
auto &GA :
M.aliases())
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
static void stringifyResult(MD5Result &Result, SmallVectorImpl< char > &Str)
Translates the bytes in Res to a hex string that is deposited into Str.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
bool nameUnamedGlobals(Module &M)
Rename all the anon globals in the module using a hash computed from the list of public globals in th...
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
A Module instance is used to store all the information related to an LLVM module.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A container for analyses that lazily runs them and caches their results.
std::array< uint32_t, 5 > ModuleHash
160 bits SHA1