Lines Matching refs:Idxs
871 ArrayRef<unsigned> Idxs) { in ConstantFoldExtractValueInstruction() argument
873 if (Idxs.empty()) in ConstantFoldExtractValueInstruction()
876 if (Constant *C = Agg->getAggregateElement(Idxs[0])) in ConstantFoldExtractValueInstruction()
877 return ConstantFoldExtractValueInstruction(C, Idxs.slice(1)); in ConstantFoldExtractValueInstruction()
884 ArrayRef<unsigned> Idxs) { in ConstantFoldInsertValueInstruction() argument
886 if (Idxs.empty()) in ConstantFoldInsertValueInstruction()
902 if (Idxs[0] == i) in ConstantFoldInsertValueInstruction()
903 C = ConstantFoldInsertValueInstruction(C, Val, Idxs.slice(1)); in ConstantFoldInsertValueInstruction()
2001 static bool isInBoundsIndices(ArrayRef<IndexTy> Idxs) { in isInBoundsIndices() argument
2003 if (Idxs.empty()) return true; in isInBoundsIndices()
2006 if (cast<Constant>(Idxs[0])->isNullValue()) return true; in isInBoundsIndices()
2010 if (!cast<ConstantInt>(Idxs[0])->isOne()) in isInBoundsIndices()
2012 for (unsigned i = 1, e = Idxs.size(); i != e; ++i) in isInBoundsIndices()
2013 if (!cast<Constant>(Idxs[i])->isNullValue()) in isInBoundsIndices()
2052 ArrayRef<IndexTy> Idxs) { in ConstantFoldGetElementPtrImpl() argument
2053 if (Idxs.empty()) return C; in ConstantFoldGetElementPtrImpl()
2054 Constant *Idx0 = cast<Constant>(Idxs[0]); in ConstantFoldGetElementPtrImpl()
2055 if ((Idxs.size() == 1 && Idx0->isNullValue())) in ConstantFoldGetElementPtrImpl()
2060 Type *Ty = GetElementPtrInst::getIndexedType(PointeeTy, Idxs); in ConstantFoldGetElementPtrImpl()
2070 for (unsigned i = 0, e = Idxs.size(); i != e; ++i) in ConstantFoldGetElementPtrImpl()
2071 if (!cast<Constant>(Idxs[i])->isNullValue()) { in ConstantFoldGetElementPtrImpl()
2077 Type *Ty = GetElementPtrInst::getIndexedType(PointeeTy, Idxs); in ConstantFoldGetElementPtrImpl()
2125 NewIndices.reserve(Idxs.size() + CE->getNumOperands()); in ConstantFoldGetElementPtrImpl()
2152 NewIndices.append(Idxs.begin() + 1, Idxs.end()); in ConstantFoldGetElementPtrImpl()
2168 if (CE->isCast() && Idxs.size() > 1 && Idx0->isNullValue()) { in ConstantFoldGetElementPtrImpl()
2181 SrcArrayTy, (Constant *)CE->getOperand(0), Idxs, inBounds); in ConstantFoldGetElementPtrImpl()
2192 bool Unknown = !isa<ConstantInt>(Idxs[0]); in ConstantFoldGetElementPtrImpl()
2193 for (unsigned i = 1, e = Idxs.size(); i != e; in ConstantFoldGetElementPtrImpl()
2194 Prev = Ty, Ty = cast<CompositeType>(Ty)->getTypeAtIndex(Idxs[i]), ++i) { in ConstantFoldGetElementPtrImpl()
2195 auto *CI = dyn_cast<ConstantInt>(Idxs[i]); in ConstantFoldGetElementPtrImpl()
2232 NewIdxs.resize(Idxs.size()); in ConstantFoldGetElementPtrImpl()
2239 Constant *PrevIdx = cast<Constant>(Idxs[i - 1]); in ConstantFoldGetElementPtrImpl()
2261 for (unsigned i = 0, e = Idxs.size(); i != e; ++i) in ConstantFoldGetElementPtrImpl()
2262 if (!NewIdxs[i]) NewIdxs[i] = cast<Constant>(Idxs[i]); in ConstantFoldGetElementPtrImpl()
2270 if (!GV->hasExternalWeakLinkage() && isInBoundsIndices(Idxs)) in ConstantFoldGetElementPtrImpl()
2271 return ConstantExpr::getInBoundsGetElementPtr(PointeeTy, C, Idxs); in ConstantFoldGetElementPtrImpl()
2278 ArrayRef<Constant *> Idxs) { in ConstantFoldGetElementPtr() argument
2279 return ConstantFoldGetElementPtrImpl(Ty, C, inBounds, Idxs); in ConstantFoldGetElementPtr()
2284 ArrayRef<Value *> Idxs) { in ConstantFoldGetElementPtr() argument
2285 return ConstantFoldGetElementPtrImpl(Ty, C, inBounds, Idxs); in ConstantFoldGetElementPtr()