Lines Matching refs:Idxs
840 ArrayRef<unsigned> Idxs) {
842 if (Idxs.empty())
845 if (Constant *C = Agg->getAggregateElement(Idxs[0]))
846 return ConstantFoldExtractValueInstruction(C, Idxs.slice(1));
853 ArrayRef<unsigned> Idxs) {
855 if (Idxs.empty())
871 if (Idxs[0] == i)
872 C = ConstantFoldInsertValueInstruction(C, Val, Idxs.slice(1));
1912 static bool isInBoundsIndices(ArrayRef<IndexTy> Idxs) {
1914 if (Idxs.empty()) return true;
1917 if (cast<Constant>(Idxs[0])->isNullValue()) return true;
1921 if (!cast<ConstantInt>(Idxs[0])->isOne())
1923 for (unsigned i = 1, e = Idxs.size(); i != e; ++i)
1924 if (!cast<Constant>(Idxs[i])->isNullValue())
1963 ArrayRef<IndexTy> Idxs) {
1964 if (Idxs.empty()) return C;
1965 Constant *Idx0 = cast<Constant>(Idxs[0]);
1966 if ((Idxs.size() == 1 && Idx0->isNullValue()))
1971 Type *Ty = GetElementPtrInst::getIndexedType(Ptr, Idxs);
1978 for (unsigned i = 0, e = Idxs.size(); i != e; ++i)
1979 if (!cast<Constant>(Idxs[i])->isNullValue()) {
1985 Type *Ty = GetElementPtrInst::getIndexedType(Ptr, Idxs);
2030 NewIndices.reserve(Idxs.size() + CE->getNumOperands());
2052 NewIndices.append(Idxs.begin() + 1, Idxs.end());
2069 if (CE->isCast() && Idxs.size() > 1 && Idx0->isNullValue()) {
2082 Idxs, inBounds);
2094 for (unsigned i = 0, e = Idxs.size(); i != e;
2095 Prev = Ty, Ty = cast<CompositeType>(Ty)->getTypeAtIndex(Idxs[i]), ++i) {
2096 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idxs[i])) {
2103 NewIdxs.resize(Idxs.size());
2113 Constant *PrevIdx = cast<Constant>(Idxs[i-1]);
2140 for (unsigned i = 0, e = Idxs.size(); i != e; ++i)
2141 if (!NewIdxs[i]) NewIdxs[i] = cast<Constant>(Idxs[i]);
2148 isa<GlobalVariable>(C) && isInBoundsIndices(Idxs))
2149 return ConstantExpr::getInBoundsGetElementPtr(C, Idxs);
2156 ArrayRef<Constant *> Idxs) {
2157 return ConstantFoldGetElementPtrImpl(C, inBounds, Idxs);
2162 ArrayRef<Value *> Idxs) {
2163 return ConstantFoldGetElementPtrImpl(C, inBounds, Idxs);