Lines Matching refs:Idxs
866 ArrayRef<unsigned> Idxs) { in ConstantFoldExtractValueInstruction() argument
868 if (Idxs.empty()) in ConstantFoldExtractValueInstruction()
871 if (Constant *C = Agg->getAggregateElement(Idxs[0])) in ConstantFoldExtractValueInstruction()
872 return ConstantFoldExtractValueInstruction(C, Idxs.slice(1)); in ConstantFoldExtractValueInstruction()
879 ArrayRef<unsigned> Idxs) { in ConstantFoldInsertValueInstruction() argument
881 if (Idxs.empty()) in ConstantFoldInsertValueInstruction()
897 if (Idxs[0] == i) in ConstantFoldInsertValueInstruction()
898 C = ConstantFoldInsertValueInstruction(C, Val, Idxs.slice(1)); in ConstantFoldInsertValueInstruction()
1976 static bool isInBoundsIndices(ArrayRef<IndexTy> Idxs) { in isInBoundsIndices() argument
1978 if (Idxs.empty()) return true; in isInBoundsIndices()
1981 if (cast<Constant>(Idxs[0])->isNullValue()) return true; in isInBoundsIndices()
1985 if (!cast<ConstantInt>(Idxs[0])->isOne()) in isInBoundsIndices()
1987 for (unsigned i = 1, e = Idxs.size(); i != e; ++i) in isInBoundsIndices()
1988 if (!cast<Constant>(Idxs[i])->isNullValue()) in isInBoundsIndices()
2027 ArrayRef<IndexTy> Idxs) { in ConstantFoldGetElementPtrImpl() argument
2028 if (Idxs.empty()) return C; in ConstantFoldGetElementPtrImpl()
2029 Constant *Idx0 = cast<Constant>(Idxs[0]); in ConstantFoldGetElementPtrImpl()
2030 if ((Idxs.size() == 1 && Idx0->isNullValue())) in ConstantFoldGetElementPtrImpl()
2036 cast<PointerType>(Ptr->getScalarType())->getElementType(), Idxs); in ConstantFoldGetElementPtrImpl()
2043 for (unsigned i = 0, e = Idxs.size(); i != e; ++i) in ConstantFoldGetElementPtrImpl()
2044 if (!cast<Constant>(Idxs[i])->isNullValue()) { in ConstantFoldGetElementPtrImpl()
2051 cast<PointerType>(Ptr->getScalarType())->getElementType(), Idxs); in ConstantFoldGetElementPtrImpl()
2096 NewIndices.reserve(Idxs.size() + CE->getNumOperands()); in ConstantFoldGetElementPtrImpl()
2123 NewIndices.append(Idxs.begin() + 1, Idxs.end()); in ConstantFoldGetElementPtrImpl()
2139 if (CE->isCast() && Idxs.size() > 1 && Idx0->isNullValue()) { in ConstantFoldGetElementPtrImpl()
2152 SrcArrayTy, (Constant *)CE->getOperand(0), Idxs, inBounds); in ConstantFoldGetElementPtrImpl()
2164 for (unsigned i = 0, e = Idxs.size(); i != e; in ConstantFoldGetElementPtrImpl()
2165 Prev = Ty, Ty = cast<CompositeType>(Ty)->getTypeAtIndex(Idxs[i]), ++i) { in ConstantFoldGetElementPtrImpl()
2166 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idxs[i])) { in ConstantFoldGetElementPtrImpl()
2173 NewIdxs.resize(Idxs.size()); in ConstantFoldGetElementPtrImpl()
2183 Constant *PrevIdx = cast<Constant>(Idxs[i-1]); in ConstantFoldGetElementPtrImpl()
2216 for (unsigned i = 0, e = Idxs.size(); i != e; ++i) in ConstantFoldGetElementPtrImpl()
2217 if (!NewIdxs[i]) NewIdxs[i] = cast<Constant>(Idxs[i]); in ConstantFoldGetElementPtrImpl()
2225 if (!GV->hasExternalWeakLinkage() && isInBoundsIndices(Idxs)) in ConstantFoldGetElementPtrImpl()
2226 return ConstantExpr::getInBoundsGetElementPtr(nullptr, C, Idxs); in ConstantFoldGetElementPtrImpl()
2233 ArrayRef<Constant *> Idxs) { in ConstantFoldGetElementPtr() argument
2234 return ConstantFoldGetElementPtrImpl(C, inBounds, Idxs); in ConstantFoldGetElementPtr()
2239 ArrayRef<Value *> Idxs) { in ConstantFoldGetElementPtr() argument
2240 return ConstantFoldGetElementPtrImpl(C, inBounds, Idxs); in ConstantFoldGetElementPtr()