49 unsigned dstAS =
dyn_cast<PointerType>(dstAddr->
getType())->getAddressSpace();
118 if (
LoadInst *load = dyn_cast<LoadInst>(II)) {
120 if (load->hasOneUse() ==
false)
126 User *use = *(load->use_begin());
127 if (
StoreInst *store = dyn_cast<StoreInst>(use)) {
128 if (store->getOperand(0) != load)
133 Value *len = intr->getLength();
136 if (
ConstantInt *len_int = dyn_cast<ConstantInt>(len)) {
144 }
else if (
MemSetInst *memsetintr = dyn_cast<MemSetInst>(II)) {
145 Value *len = memsetintr->getLength();
146 if (
ConstantInt *len_int = dyn_cast<ConstantInt>(len)) {
157 if ((aggrLoads.
size() == 0) && (aggrMemcpys.
size() == 0) &&
158 (aggrMemsets.
size() == 0))
164 for (
unsigned i = 0, e = aggrLoads.
size(); i != e; ++i) {
179 for (
unsigned i = 0, e = aggrMemcpys.
size(); i != e; ++i) {
191 for (
unsigned i = 0, e = aggrMemsets.
size(); i != e; ++i) {
Value * CreateGEP(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &Name="")
void push_back(const T &Elt)
LoadInst * CreateLoad(Value *Ptr, const char *Name)
void addIncoming(Value *V, BasicBlock *BB)
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static PointerType * get(Type *ElementType, unsigned AddressSpace)
Value * CreateICmpULT(Value *LHS, Value *RHS, const Twine &Name="")
PHINode * CreatePHI(Type *Ty, unsigned NumReservedValues, const Twine &Name="")
BranchInst * CreateCondBr(Value *Cond, BasicBlock *True, BasicBlock *False, MDNode *BranchWeights=0)
Create a conditional 'br Cond, TrueDest, FalseDest' instruction.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
FunctionPass * createLowerAggrCopies()
void setSuccessor(unsigned idx, BasicBlock *B)
StoreInst * CreateStore(Value *Val, Value *Ptr, bool isVolatile=false)
LLVM Basic Block Representation.
Value * CreateAdd(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
Value * getOperand(unsigned i) const
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
Class for constant integers.
static void convertMemSetToLoop(Instruction *splitAt, Value *dstAddr, Value *len, Value *val, LLVMContext &Context, Function &F)
Value * getLength() const
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
static void convertTransferToLoop(Instruction *splitAt, Value *srcAddr, Value *dstAddr, Value *len, bool srcVolatile, bool dstVolatile, LLVMContext &Context, Function &F)
Value * getSource() const
static IntegerType * getInt32Ty(LLVMContext &C)
static const unsigned MaxAggrCopySize
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=0, BasicBlock *InsertBefore=0)
Creates a new BasicBlock.
virtual bool runOnFunction(Function &F)
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction.
uint64_t getTypeStoreSize(Type *Ty) const
LLVM Value Representation.
const BasicBlock * getParent() const
INITIALIZE_PASS(GlobalMerge,"global-merge","Global Merge", false, false) bool GlobalMerge const DataLayout * TD
LLVMContext & getContext() const