LLVM: lib/IR/Constants.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define HANDLE_CONSTANT(Name)
#define HANDLE_CONSTANT(Name)
Functions
static bool containsUndefinedElement (const Constant *C, function_ref< bool(const Constant *)> HasFn)
static bool ConstHasGlobalValuePredicate (const Constant *C, bool(*Predicate)(const GlobalValue *))
Check if C contains a GlobalValue for which Predicate is true.
static bool constantIsDead (const Constant *C, bool RemoveDeadUsers)
Return true if the specified constantexpr is dead.
template<typename ItTy, typename EltTy>
static bool rangeOnlyContains (ItTy Start, ItTy End, EltTy Elt)
template<typename SequentialTy, typename ElementTy>
static Constant * getIntSequenceIfElementsMatch (ArrayRef< Constant * > V)
template<typename SequentialTy, typename ElementTy>
static Constant * getFPSequenceIfElementsMatch (ArrayRef< Constant * > V)
template
static Constant * getSequenceIfElementsMatch (Constant *C, ArrayRef< Constant * > V)
static Constant * getFoldedCast (Instruction::CastOps opc, Constant *C, Type *Ty, bool OnlyIfReduced=false)
This is a utility function to handle folding of casts and lookup of the cast in the ExprConstants map.
static bool isAllZeros (StringRef Arr)
Return true if the array is empty or all zeros.
Variables
static cl::opt< bool > UseConstantIntForFixedLengthSplat ("use-constant-int-for-fixed-length-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantInt's native fixed-length vector splat support."))
static cl::opt< bool > UseConstantFPForFixedLengthSplat ("use-constant-fp-for-fixed-length-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantFP's native fixed-length vector splat support."))
static cl::opt< bool > UseConstantIntForScalableSplat ("use-constant-int-for-scalable-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantInt's native scalable vector splat support."))
static cl::opt< bool > UseConstantFPForScalableSplat ("use-constant-fp-for-scalable-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantFP's native scalable vector splat support."))

HANDLE_CONSTANT [1/2]

#define HANDLE_CONSTANT ( Name )

Value:

case Value::Name##Val: \

cast(this)->destroyConstantImpl(); \

break;

HANDLE_CONSTANT [2/2]

#define HANDLE_CONSTANT ( Name )

Value:

case Value::Name##Val: \

Replacement = cast(this)->handleOperandChangeImpl(From, To); \

break;

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

constantIsDead()

ConstHasGlobalValuePredicate()

containsUndefinedElement()

getFoldedCast()

This is a utility function to handle folding of casts and lookup of the cast in the ExprConstants map.

It is used by the various get* methods below.

Definition at line 2226 of file Constants.cpp.

References assert(), llvm::CallingConv::C, llvm::ConstantFoldCastInstruction(), llvm::LLVMContextImpl::ExprConstants, and llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key.

Referenced by llvm::ConstantExpr::getAddrSpaceCast(), llvm::ConstantExpr::getBitCast(), llvm::ConstantExpr::getIntToPtr(), llvm::ConstantExpr::getPtrToAddr(), llvm::ConstantExpr::getPtrToInt(), and llvm::ConstantExpr::getTrunc().

getFPSequenceIfElementsMatch()

template<typename SequentialTy, typename ElementTy>

getIntSequenceIfElementsMatch()

template<typename SequentialTy, typename ElementTy>

getSequenceIfElementsMatch()

template

isAllZeros()

rangeOnlyContains()

template<typename ItTy, typename EltTy>

bool rangeOnlyContains ( ItTy Start, ItTy End, EltTy Elt ) static

UseConstantFPForFixedLengthSplat

cl::opt< bool > UseConstantFPForFixedLengthSplat("use-constant-fp-for-fixed-length-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantFP's native fixed-length vector splat support.")) ( "use-constant-fp-for-fixed-length-splat" , cl::init(false) , cl::Hidden , cl::desc("Use ConstantFP's native fixed-length vector splat support.") ) static

UseConstantFPForScalableSplat

cl::opt< bool > UseConstantFPForScalableSplat("use-constant-fp-for-scalable-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantFP's native scalable vector splat support.")) ( "use-constant-fp-for-scalable-splat" , cl::init(false) , cl::Hidden , cl::desc("Use ConstantFP's native scalable vector splat support.") ) static

UseConstantIntForFixedLengthSplat

cl::opt< bool > UseConstantIntForFixedLengthSplat("use-constant-int-for-fixed-length-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantInt's native fixed-length vector splat support.")) ( "use-constant-int-for-fixed-length-splat" , cl::init(false) , cl::Hidden , cl::desc("Use ConstantInt's native fixed-length vector splat support.") ) static

UseConstantIntForScalableSplat

cl::opt< bool > UseConstantIntForScalableSplat("use-constant-int-for-scalable-splat", cl::init(false), cl::Hidden, cl::desc("Use ConstantInt's native scalable vector splat support.")) ( "use-constant-int-for-scalable-splat" , cl::init(false) , cl::Hidden , cl::desc("Use ConstantInt's native scalable vector splat support.") ) static