class InternalizePass
Declaration
class InternalizePass : public PassInfoMixin { /* full declaration omitted */ };
Description
A pass that internalizes all functions and variables other than those that must be preserved according to \c MustPreserveGV.
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:35
Inherits from: PassInfoMixin
Member Variables
- private bool IsWasm = false
- private const std::function<bool(const GlobalValue&)> MustPreserveGV
- Client supplied callback to control wheter a symbol must be preserved.
- private StringSet<> AlwaysPreserved
- Set of symbols private to the compiler that this pass should not touch.
Method Overview
- public InternalizePass()
- public InternalizePass(std::function<bool (const GlobalValue &)> MustPreserveGV)
- private void checkComdat(llvm::GlobalValue & GV, DenseMap<const llvm::Comdat *, llvm::InternalizePass::ComdatInfo> & ComdatMap)
- public bool internalizeModule(llvm::Module & TheModule, llvm::CallGraph * CG = nullptr)
- private bool maybeInternalize(llvm::GlobalValue & GV, DenseMap<const llvm::Comdat *, llvm::InternalizePass::ComdatInfo> & ComdatMap)
- public llvm::PreservedAnalyses run(llvm::Module & M, llvm::ModuleAnalysisManager & AM)
- private bool shouldPreserveGV(const llvm::GlobalValue & GV)
Methods
¶InternalizePass()
InternalizePass()
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:63
¶InternalizePass(
std::function<bool(const GlobalValue&)>
MustPreserveGV)
InternalizePass(
std::function<bool(const GlobalValue&)>
MustPreserveGV)
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:64
Parameters
- std::function<bool(const GlobalValue&)> MustPreserveGV
¶void checkComdat(
llvm::GlobalValue& GV,
DenseMap<const llvm::Comdat*,
llvm::InternalizePass::ComdatInfo>&
ComdatMap)
void checkComdat(
llvm::GlobalValue& GV,
DenseMap<const llvm::Comdat*,
llvm::InternalizePass::ComdatInfo>&
ComdatMap)
Description
If GV is part of a comdat and is externally visible, keep track of its comdat so that we don't internalize any of its members.
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:59
Parameters
- llvm::GlobalValue& GV
- DenseMap<const llvm::Comdat*, llvm::InternalizePass::ComdatInfo>& ComdatMap
¶bool internalizeModule(
llvm::Module& TheModule,
llvm::CallGraph* CG = nullptr)
bool internalizeModule(
llvm::Module& TheModule,
llvm::CallGraph* CG = nullptr)
Description
Run the internalizer on \p TheModule, returns true if any changes was made. If the CallGraph \p CG is supplied, it will be updated when internalizing a function (by removing any edge from the "external node")
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:72
Parameters
- llvm::Module& TheModule
- llvm::CallGraph* CG = nullptr
¶bool maybeInternalize(
llvm::GlobalValue& GV,
DenseMap<const llvm::Comdat*,
llvm::InternalizePass::ComdatInfo>&
ComdatMap)
bool maybeInternalize(
llvm::GlobalValue& GV,
DenseMap<const llvm::Comdat*,
llvm::InternalizePass::ComdatInfo>&
ComdatMap)
Description
Internalize GV if it is possible to do so, i.e. it is not externally visible and is not a member of an externally visible comdat.
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:55
Parameters
- llvm::GlobalValue& GV
- DenseMap<const llvm::Comdat*, llvm::InternalizePass::ComdatInfo>& ComdatMap
¶llvm::PreservedAnalyses run(
llvm::Module& M,
llvm::ModuleAnalysisManager& AM)
llvm::PreservedAnalyses run(
llvm::Module& M,
llvm::ModuleAnalysisManager& AM)
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:74
Parameters
¶bool shouldPreserveGV(const llvm::GlobalValue& GV)
bool shouldPreserveGV(const llvm::GlobalValue& GV)
Description
Return false if we're allowed to internalize this GV.
Declared at: llvm/include/llvm/Transforms/IPO/Internalize.h:52
Parameters
- const llvm::GlobalValue& GV