LLVM: llvm::GlobalMergeFunc Class Reference (original) (raw)
GlobalMergeFunc is a ModulePass that implements a function merging mechanism using stable function hashes. More...
#include "[llvm/CodeGen/GlobalMergeFunctions.h](GlobalMergeFunctions%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| GlobalMergeFunc (const ModuleSummaryIndex *Index) | |
| void | initializeMergerMode (const Module &M) |
| bool | run (Module &M) |
| void | analyze (Module &M) |
| Analyze module to create stable function into LocalFunctionMap. | |
| void | emitFunctionMap (Module &M) |
| Emit LocalFunctionMap into __llvm_merge section. | |
| bool | merge (Module &M, const StableFunctionMap *FunctionMap) |
| Merge functions in the module using the given function map. |
| Static Public Attributes | |
|---|---|
| static constexpr char | MergingInstanceSuffix [] = ".Tgm" |
| The suffix used to identify the merged function that parameterizes the constant values. |
GlobalMergeFunc is a ModulePass that implements a function merging mechanism using stable function hashes.
It identifies and merges functions with matching hashes across modules to optimize binary size.
Definition at line 50 of file GlobalMergeFunctions.h.
◆ analyze()
| void GlobalMergeFunc::analyze | ( | Module & | M | ) |
|---|
◆ emitFunctionMap()
| void GlobalMergeFunc::emitFunctionMap | ( | Module & | M | ) |
|---|
◆ initializeMergerMode()
| void GlobalMergeFunc::initializeMergerMode | ( | const Module & | M | ) |
|---|
◆ merge()
Merge functions in the module using the given function map.
Definition at line 392 of file GlobalMergeFunctions.cpp.
References assert(), llvm::StableFunctionMap::at(), llvm::cast(), Changed, checkConstHashCompatible(), checkConstLocationCompatible(), computeParamInfo(), llvm::StableFunctionMap::contains(), createMergedFunction(), createThunk(), llvm::dbgs(), llvm::Value::dump(), llvm::SmallVectorImpl< T >::emplace_back(), F, llvm::Value::getName(), ignoreOp(), llvm::StableFunctionMap::StableFunctionEntry::IndexOperandHashMap, llvm::StableFunctionMap::StableFunctionEntry::InstCount, isEligibleFunction(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::StructuralHashWithDifferences().
Referenced by run().
◆ run()
◆ MergingInstanceSuffix
| char llvm::GlobalMergeFunc::MergingInstanceSuffix[] = ".Tgm" | staticconstexpr |
|---|
The suffix used to identify the merged function that parameterizes the constant values.
Note that the original function, without this suffix, becomes a thunk supplying contexts to the merged function via parameters.
Definition at line 61 of file GlobalMergeFunctions.h.
Referenced by createMergedFunction().
The documentation for this class was generated from the following files:
- include/llvm/CodeGen/GlobalMergeFunctions.h
- lib/CodeGen/GlobalMergeFunctions.cpp