LLVM  6.0.0svn
Macros | Functions
ConstantMerge.cpp File Reference
#include "llvm/Transforms/IPO/ConstantMerge.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/IPO.h"
Include dependency graph for ConstantMerge.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "constmerge"
 

Functions

 STATISTIC (NumMerged, "Number of global constants merged")
 
static void FindUsedValues (GlobalVariable *LLVMUsed, SmallPtrSetImpl< const GlobalValue *> &UsedValues)
 Find values that are marked as llvm.used. More...
 
static bool IsBetterCanonical (const GlobalVariable &A, const GlobalVariable &B)
 
static bool hasMetadataOtherThanDebugLoc (const GlobalVariable *GV)
 
static void copyDebugLocMetadata (const GlobalVariable *From, GlobalVariable *To)
 
static unsigned getAlignment (GlobalVariable *GV)
 
static bool mergeConstants (Module &M)
 
 INITIALIZE_PASS (ConstantMergeLegacyPass, "constmerge", "Merge Duplicate Global Constants", false, false) ModulePass *llvm
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "constmerge"

Definition at line 34 of file ConstantMerge.cpp.

Function Documentation

◆ copyDebugLocMetadata()

static void copyDebugLocMetadata ( const GlobalVariable From,
GlobalVariable To 
)
static

◆ FindUsedValues()

static void FindUsedValues ( GlobalVariable LLVMUsed,
SmallPtrSetImpl< const GlobalValue *> &  UsedValues 
)
static

◆ getAlignment()

static unsigned getAlignment ( GlobalVariable GV)
static

◆ hasMetadataOtherThanDebugLoc()

static bool hasMetadataOtherThanDebugLoc ( const GlobalVariable GV)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( ConstantMergeLegacyPass  ,
"constmerge"  ,
"Merge Duplicate Global Constants"  ,
false  ,
false   
)

Definition at line 245 of file ConstantMerge.cpp.

◆ IsBetterCanonical()

static bool IsBetterCanonical ( const GlobalVariable A,
const GlobalVariable B 
)
static

◆ mergeConstants()

static bool mergeConstants ( Module M)
static

◆ STATISTIC()

STATISTIC ( NumMerged  ,
"Number of global constants merged"   
)