|
LLVM
4.0.0
|
#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"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 unsigned | getAlignment (GlobalVariable *GV) |
| static bool | mergeConstants (Module &M) |
| INITIALIZE_PASS (ConstantMergeLegacyPass,"constmerge","Merge Duplicate Global Constants", false, false) ModulePass *llvm | |
| #define DEBUG_TYPE "constmerge" |
Definition at line 34 of file ConstantMerge.cpp.
|
static |
Find values that are marked as llvm.used.
Definition at line 39 of file ConstantMerge.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::User::getOperand(), i, llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::Value::stripPointerCastsNoFollowAliases().
Referenced by mergeConstants().
|
static |
Definition at line 63 of file ConstantMerge.cpp.
References llvm::GlobalObject::getAlignment(), llvm::Module::getDataLayout(), llvm::GlobalValue::getParent(), and llvm::DataLayout::getPreferredAlignment().
Referenced by llvm::FunctionComparator::cmpOperations(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::ARMBaseInstrInfo::getNumMicroOps(), llvm::ARMBaseInstrInfo::getOperandLatency(), haveSameSpecialState(), LowerVectorBroadcast(), mergeConstants(), llvm::SIFrameLowering::processFunctionBeforeFrameFinalized(), and RewriteP2Align().
| INITIALIZE_PASS | ( | ConstantMergeLegacyPass | , |
| "constmerge" | , | ||
| "Merge Duplicate Global Constants" | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 219 of file ConstantMerge.cpp.
|
static |
Definition at line 52 of file ConstantMerge.cpp.
References llvm::GlobalValue::hasGlobalUnnamedAddr(), and llvm::GlobalValue::hasLocalLinkage().
Referenced by mergeConstants().
Definition at line 70 of file ConstantMerge.cpp.
References assert(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallPtrSetImpl< PtrType >::count(), E, llvm::SmallVectorBase::empty(), llvm::GlobalVariable::eraseFromParent(), FindUsedValues(), llvm::PointerType::getAddressSpace(), getAlignment(), llvm::Module::getGlobalVariable(), llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getType(), llvm::Module::global_begin(), llvm::Module::global_end(), llvm::GlobalVariable::hasDefinitiveInitializer(), llvm::GlobalValue::hasGlobalUnnamedAddr(), llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalObject::hasSection(), i, IsBetterCanonical(), llvm::GlobalVariable::isConstant(), llvm::GlobalValue::isWeakForLinker(), llvm::GlobalValue::None, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Constant::removeDeadConstantUsers(), llvm::GlobalValue::setUnnamedAddr(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::Value::use_empty().
Referenced by llvm::ConstantMergePass::run().
| STATISTIC | ( | NumMerged | , |
| "Number of global constants merged" | |||
| ) |
1.8.6