Lines Matching refs:GEPI

880 static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI,  in canReplaceGEPIdxWithZero()  argument
882 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
887 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
889 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
890 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
903 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
904 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
906 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
909 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
911 GetElementPtrInst::getIndexedType(GEPI->getSourceElementType(), Ops); in canReplaceGEPIdxWithZero()
922 for (unsigned i = Idx+1, e = GEPI->getNumOperands(); i != e; ++i) { in canReplaceGEPIdxWithZero()
923 KnownBits Known = IC.computeKnownBits(GEPI->getOperand(i), 0, MemI); in canReplaceGEPIdxWithZero()
937 if (Idx+1 != GEPI->getNumOperands() && !GEPI->isInBounds()) in canReplaceGEPIdxWithZero()
942 return isObjectSizeLessThanOrEq(GEPI->getOperand(0), TyAllocSize, DL) && in canReplaceGEPIdxWithZero()
952 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Ptr)) { in replaceGEPIdxWithZero() local
954 if (canReplaceGEPIdxWithZero(IC, GEPI, &MemI, Idx)) { in replaceGEPIdxWithZero()
955 Instruction *NewGEPI = GEPI->clone(); in replaceGEPIdxWithZero()
957 ConstantInt::get(GEPI->getOperand(Idx)->getType(), 0)); in replaceGEPIdxWithZero()
958 NewGEPI->insertBefore(GEPI); in replaceGEPIdxWithZero()
972 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Ptr)) in canSimplifyNullStoreOrGEP() local
973 Ptr = GEPI->getOperand(0); in canSimplifyNullStoreOrGEP()
979 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { in canSimplifyNullLoadOrGEP() local
980 const Value *GEPI0 = GEPI->getOperand(0); in canSimplifyNullLoadOrGEP()
982 !NullPointerIsDefined(LI.getFunction(), GEPI->getPointerAddressSpace())) in canSimplifyNullLoadOrGEP()