LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions | Variables
GlobalMerge.cpp File Reference
#include "llvm/Transforms/Scalar.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
Include dependency graph for GlobalMerge.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "global-merge"
 

Functions

 STATISTIC (NumMerged,"Number of globals merged")
 
 for (size_t i=0, e=Globals.size();i!=e;)
 

Variables

static cl::opt< boolEnableGlobalMergeOnConst ("global-merge-on-const", cl::Hidden, cl::desc("Enable global merge pass on constants"), cl::init(false))
 
INITIALIZE_PASS(GlobalMerge,"global-merge","Global
Merge", false, false) bool
GlobalMerge const DataLayout
TD = TLI->getDataLayout()
 
unsigned MaxOffset = TLI->getMaximalGlobalOffset()
 
TypeInt32Ty = Type::getInt32Ty(M.getContext())
 
return true
 

Macro Definition Documentation

#define DEBUG_TYPE   "global-merge"

Definition at line 54 of file GlobalMerge.cpp.

Function Documentation

for ( size_t  i = 0,
= Globals.size(); i != e; 
)
STATISTIC ( NumMerged  ,
"Number of globals merged"   
)

Variable Documentation

cl::opt<bool> EnableGlobalMergeOnConst("global-merge-on-const", cl::Hidden, cl::desc("Enable global merge pass on constants"), cl::init(false))
static
Type* Int32Ty = Type::getInt32Ty(M.getContext())
unsigned MaxOffset = TLI->getMaximalGlobalOffset()
INITIALIZE_PASS (GlobalMerge, "global-merge", "Global Merge", false, false) bool GlobalMerge const DataLayout* TD = TLI->getDataLayout()

Definition at line 146 of file GlobalMerge.cpp.

Referenced by AnalyzeLoadFromClobberingMemInst(), CanShareConstantPoolEntry(), llvm::InstCombiner::commonCastTransforms(), llvm::InstCombiner::commonPointerCastTransforms(), llvm::ComputeMaskedBits(), llvm::InstCombiner::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::InstCombiner::ComputeNumSignBits(), llvm::ComputeSignBit(), llvm::ConstantFoldCompareInstOperands(), ConstantFoldConstantExpressionImpl(), llvm::ConstantFoldInstOperands(), llvm::ConstantFoldInstruction(), llvm::SelectionDAG::CreateStackTemporary(), llvm::InstCombiner::DoOneIteration(), llvm::SystemZAsmPrinter::EmitEndOfAsmFile(), llvm::AArch64AsmPrinter::EmitEndOfAsmFile(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), EvaluateExpression(), EvaluateGEPOffsetExpression(), llvm::SimplifyFortifiedLibCalls::fold(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::InstCombiner::FoldGEPICmp(), FoldReinterpretLoadFromConstPtr(), GatherConstantCompares(), llvm::InstCombiner::getDataLayout(), llvm::ExecutionEngine::getDataLayout(), llvm::InlineCostAnalysis::getInlineCost(), llvm::getKnownAlignment(), GetLinearExpression(), GetLoadValueForLoad(), llvm::LazyValueInfo::getPredicateOnEdge(), llvm::NVPTXTargetLowering::getPrototype(), llvm::GetUnderlyingObject(), IsConstantOffsetFromGlobal(), llvm::isKnownNonZero(), llvm::XCoreTargetLowering::isLegalAddressingMode(), isOverwrite(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), llvm::isSafeToSpeculativelyExecute(), isSimpleEnoughValueToCommitHelper(), nvptx::LowerConstant(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), llvm::InstCombiner::MaskedValueIsZero(), llvm::InstCombiner::OptimizePointerDifference(), ReadDataFromGlobal(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::LazyValueInfo::runOnFunction(), llvm::InstCombiner::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::InlineCostAnalysis::runOnSCC(), llvm::ExecutionEngine::setDataLayout(), llvm::SimplifyInstruction(), SimplifyWithOpReplaced(), SwitchToLookupTable(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFRem(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithCastAndCast(), llvm::InstCombiner::visitIntToPtr(), llvm::InstCombiner::visitLShr(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPtrToInt(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitSelectInst(), llvm::InstCombiner::visitSelectInstWithICmp(), llvm::InstCombiner::visitShl(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitUDiv(), llvm::InstCombiner::visitURem(), and llvm::InstCombiner::visitXor().

return true

Definition at line 193 of file GlobalMerge.cpp.