34 const unsigned *Indices,
35 const unsigned *IndicesEnd,
38 if (Indices && Indices == IndicesEnd)
42 if (
StructType *STy = dyn_cast<StructType>(Ty)) {
45 EE = STy->element_end();
47 if (Indices && *Indices ==
unsigned(EI - EB))
54 else if (
ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
55 Type *EltTy = ATy->getElementType();
56 for (
unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) {
57 if (Indices && *Indices == i)
77 uint64_t StartingOffset) {
79 if (
StructType *STy = dyn_cast<StructType>(Ty)) {
83 EE = STy->element_end();
90 if (
ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
91 Type *EltTy = ATy->getElementType();
93 for (
unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)
95 StartingOffset + i * EltSize);
112 if (GV && GV->
getName() ==
"llvm.eh.catch.all.value") {
114 "The EH catch-all value must have an initializer");
117 if (!GV) V = cast<ConstantPointerNull>(Init);
120 assert((GV || isa<ConstantPointerNull>(V)) &&
121 "TypeInfo must be a global variable or NULL");
130 for (
unsigned i = 0, e = CInfos.size(); i != e; ++i) {
132 for (
unsigned j = 0, ee = CI.
Codes.size(); j != ee; ++j) {
207 (isa<VectorType>(T1) && isa<VectorType>(T2) &&
231 const Value *NoopInput = 0;
234 if (isa<BitCastInst>(I)) {
238 }
else if (isa<GetElementPtrInst>(I)) {
240 if (cast<GetElementPtrInst>(I)->hasAllZeroIndices())
242 }
else if (isa<IntToPtrInst>(I)) {
246 if (!isa<VectorType>(I->
getType()) &&
250 }
else if (isa<PtrToIntInst>(I)) {
254 if (!isa<VectorType>(I->
getType()) &&
258 }
else if (isa<TruncInst>(I) &&
262 }
else if (isa<CallInst>(I)) {
266 unsigned attrInd = i - I->
op_begin() + 1;
273 }
else if (isa<InvokeInst>(I)) {
277 unsigned attrInd = i - I->
op_begin() + 1;
284 }
else if (
const InsertValueInst *IVI = dyn_cast<InsertValueInst>(V)) {
293 NoopInput = IVI->getInsertedValueOperand();
304 std::copy(ExtractLoc.
rbegin(), ExtractLoc.
rend(),
305 std::back_inserter(ValLoc));
323 bool AllowDifferingSizes,
330 unsigned BitsRequired = UINT_MAX;
331 RetVal =
getNoopInput(RetVal, RetIndices, BitsRequired, TLI);
335 if (isa<UndefValue>(RetVal))
342 unsigned BitsProvided = UINT_MAX;
343 CallVal =
getNoopInput(CallVal, CallIndices, BitsProvided, TLI);
347 if (CallVal != RetVal || CallIndices != RetIndices)
354 if (BitsProvided < BitsRequired ||
355 (!AllowDifferingSizes && BitsProvided != BitsRequired))
364 if (
ArrayType *AT = dyn_cast<ArrayType>(T))
365 return Idx < AT->getNumElements();
367 return Idx < cast<StructType>(
T)->getNumElements();
436 SubTypes.
push_back(cast<CompositeType>(Next));
438 Next = cast<CompositeType>(Next)->getTypeAtIndex(0U);
464 assert(!Path.
empty() &&
"found a leaf but didn't set the path?");
494 !isa<UnreachableInst>(Term)))
506 if (isa<DbgInfoIntrinsic>(BBI))
508 if (BBI->mayHaveSideEffects() || BBI->mayReadFromMemory() ||
526 if (isa<UndefValue>(Ret->
getOperand(0)))
return true;
530 AttributeSet::ReturnIndex);
532 AttributeSet::ReturnIndex);
539 bool AllowDifferingSizes =
true;
544 AllowDifferingSizes =
false;
551 AllowDifferingSizes =
false;
559 if (CallerAttrs != CalleeAttrs)
596 copy(RetPath.
rbegin(), RetPath.
rend(), std::back_inserter(TmpRetPath));
597 copy(CallPath.
rbegin(), CallPath.
rend(), std::back_inserter(TmpCallPath));
602 AllowDifferingSizes, TLI))
void push_back(const T &Elt)
ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred)
void ComputeValueVTs(const TargetLowering &TLI, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=0, uint64_t StartingOffset=0)
GlobalVariable * ExtractTypeInfo(Value *V)
ExtractTypeInfo - Returns the type info, possibly bitcast, encoded in V.
Sign extended before/after call.
const TargetMachine & getTargetMachine() const
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getNumOperands() const
virtual bool allowTruncateForTailCall(Type *, Type *) const
virtual ConstraintType getConstraintType(const std::string &Constraint) const
Given a constraint, return the type of constraint it is for this target.
bool mayHaveSideEffects() const
0 1 0 0 True if ordered and less than
unsigned getSizeInBits() const
1 1 1 0 True if unordered or not equal
const Function * getParent() const
Return the enclosing method, or null if none.
const Constant * getInitializer() const
bool returnTypeIsEligibleForTailCall(const Function *F, const Instruction *I, const ReturnInst *Ret, const TargetLoweringBase &TLI)
ConstraintCodeVector Codes
EVT getValueType(Type *Ty, bool AllowUnknown=false) const
StringRef getName() const
1 0 0 1 True if unordered or equal
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
static unsigned getBitWidth(Type *Ty, const DataLayout *TD)
Type::subtype_iterator element_iterator
const StructLayout * getStructLayout(StructType *Ty) const
#define llvm_unreachable(msg)
0 1 0 1 True if ordered and less than or equal
virtual MVT getPointerTy(uint32_t=0) const
bool mayReadFromMemory() const
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
reverse_iterator rbegin() const
static bool nextRealType(SmallVectorImpl< CompositeType * > &SubTypes, SmallVectorImpl< unsigned > &Path)
ISD::CondCode getFCmpCondCode(FCmpInst::Predicate Pred)
size_t size() const
size - Get the array size.
Considered to not alias after call.
bool hasInlineAsmMemConstraint(InlineAsm::ConstraintInfoVector &CInfos, const TargetLowering &TLI)
uint64_t getElementOffset(unsigned Idx) const
static bool indexReallyValid(CompositeType *T, unsigned Idx)
reverse_iterator rend() const
bool isTypeLegal(EVT VT) const
LLVM Basic Block Representation.
InstrTy * getInstruction() const
bool isInTailCallPosition(ImmutableCallSite CS, const TargetLowering &TLI)
Return value is always equal to this argument.
const DataLayout * getDataLayout() const
Type * getTypeAtIndex(const Value *V)
unsigned GuaranteedTailCallOpt
Value * getOperand(unsigned i) const
Zero extended before/after call.
0 1 1 1 True if ordered (no nans)
static bool slotOnlyDiscardsData(const Value *RetVal, const Value *CallVal, SmallVectorImpl< unsigned > &RetIndices, SmallVectorImpl< unsigned > &CallIndices, bool AllowDifferingSizes, const TargetLoweringBase &TLI)
1 1 1 1 Always true (always folded)
static UndefValue * get(Type *T)
1 1 0 1 True if unordered, less than, or equal
bool isSafeToSpeculativelyExecute(const Value *V, const DataLayout *TD=0)
0 0 1 0 True if ordered and greater than
uint64_t getTypeAllocSize(Type *Ty) const
static bool isNoopBitcast(Type *T1, Type *T2, const TargetLoweringBase &TLI)
1 1 0 0 True if unordered or less than
Value * stripPointerCasts()
Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value...
ISD::CondCode getFCmpCodeWithoutNaN(ISD::CondCode CC)
AttributeSet getAttributes() const
Return the attribute list for this Function.
bool hasInitializer() const
bool isAggregateType() const
unsigned greater or equal
ImmutableCallSite - establish a view to a call site for examination.
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
0 1 1 0 True if ordered and operands are unequal
unsigned getPrimitiveSizeInBits() const
1 0 1 0 True if unordered or greater than
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
AttributeSet getAttributes(LLVMContext &C, ID id)
static const Value * getNoopInput(const Value *V, SmallVectorImpl< unsigned > &ValLoc, unsigned &DataBits, const TargetLoweringBase &TLI)
reverse_iterator rbegin()
0 0 0 1 True if ordered and equal
LLVM Value Representation.
1 0 1 1 True if unordered, greater than, or equal
ItTy prior(ItTy it, Dist n)
static bool advanceToNextLeafType(SmallVectorImpl< CompositeType * > &SubTypes, SmallVectorImpl< unsigned > &Path)
0 0 1 1 True if ordered and greater than or equal
unsigned ComputeLinearIndex(Type *Ty, const unsigned *Indices, const unsigned *IndicesEnd, unsigned CurIndex=0)
std::vector< ConstraintInfo > ConstraintInfoVector
const BasicBlock * getParent() const
0 0 0 0 Always false (always folded)
bool isVoidTy() const
isVoidTy - Return true if this is 'void'.
static bool firstRealType(Type *Next, SmallVectorImpl< CompositeType * > &SubTypes, SmallVectorImpl< unsigned > &Path)