LLVM  6.0.0svn
Namespaces | Macros | Functions
InferAddressSpaces.cpp File Reference
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
Include dependency graph for InferAddressSpaces.cpp:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define DEBUG_TYPE   "infer-address-spaces"
 

Functions

void llvm::initializeInferAddressSpacesPass (PassRegistry &)
 
 INITIALIZE_PASS (InferAddressSpaces, DEBUG_TYPE, "Infer address spaces", false, false) static bool isAddressExpression(const Value &V)
 
static SmallVector< Value *, 2 > getPointerOperands (const Value &V)
 
static ValueoperandWithNewAddressSpaceOrCreateUndef (const Use &OperandUse, unsigned NewAddrSpace, const ValueToValueMapTy &ValueWithNewAddrSpace, SmallVectorImpl< const Use *> *UndefUsesToFix)
 
static ValuecloneInstructionWithNewAddressSpace (Instruction *I, unsigned NewAddrSpace, const ValueToValueMapTy &ValueWithNewAddrSpace, SmallVectorImpl< const Use *> *UndefUsesToFix)
 
static ValuecloneConstantExprWithNewAddressSpace (ConstantExpr *CE, unsigned NewAddrSpace, const ValueToValueMapTy &ValueWithNewAddrSpace)
 
static bool isSimplePointerUseValidToReplace (Use &U)
 returns true if U is the pointer operand of a memory instruction with a single pointer operand that can have its address space changed by simply mutating the use to a new value. More...
 
static bool handleMemIntrinsicPtrUse (MemIntrinsic *MI, Value *OldV, Value *NewV)
 Update memory intrinsic uses that require more complex processing than simple memory instructions. More...
 
static Value::use_iterator skipToNextUser (Value::use_iterator I, Value::use_iterator End)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "infer-address-spaces"

Definition at line 108 of file InferAddressSpaces.cpp.

Function Documentation

◆ cloneConstantExprWithNewAddressSpace()

static Value* cloneConstantExprWithNewAddressSpace ( ConstantExpr CE,
unsigned  NewAddrSpace,
const ValueToValueMapTy ValueWithNewAddrSpace 
)
static

◆ cloneInstructionWithNewAddressSpace()

static Value* cloneInstructionWithNewAddressSpace ( Instruction I,
unsigned  NewAddrSpace,
const ValueToValueMapTy ValueWithNewAddrSpace,
SmallVectorImpl< const Use *> *  UndefUsesToFix 
)
static

◆ getPointerOperands()

static SmallVector<Value *, 2> getPointerOperands ( const Value V)
static

◆ handleMemIntrinsicPtrUse()

static bool handleMemIntrinsicPtrUse ( MemIntrinsic MI,
Value OldV,
Value NewV 
)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( InferAddressSpaces  ,
DEBUG_TYPE  ,
"Infer address spaces"  ,
false  ,
false   
) const &

Definition at line 183 of file InferAddressSpaces.cpp.

References llvm::MCID::Select.

◆ isSimplePointerUseValidToReplace()

static bool isSimplePointerUseValidToReplace ( Use U)
static

returns true if U is the pointer operand of a memory instruction with a single pointer operand that can have its address space changed by simply mutating the use to a new value.

Definition at line 714 of file InferAddressSpaces.cpp.

References llvm::Use::getOperandNo(), llvm::LoadInst::getPointerOperandIndex(), llvm::StoreInst::getPointerOperandIndex(), llvm::AtomicCmpXchgInst::getPointerOperandIndex(), llvm::AtomicRMWInst::getPointerOperandIndex(), llvm::Use::getUser(), and SI.

Referenced by skipToNextUser().

◆ operandWithNewAddressSpaceOrCreateUndef()

static Value* operandWithNewAddressSpaceOrCreateUndef ( const Use OperandUse,
unsigned  NewAddrSpace,
const ValueToValueMapTy ValueWithNewAddrSpace,
SmallVectorImpl< const Use *> *  UndefUsesToFix 
)
static

◆ skipToNextUser()

static Value::use_iterator skipToNextUser ( Value::use_iterator  I,
Value::use_iterator  End 
)
static