Lines Matching refs:GEPI
812 GetElementPtrInst *GEPI, Instruction *MemI, in canReplaceGEPIdxWithZero() argument
814 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
819 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
821 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
822 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
835 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
836 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
838 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
841 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
842 Type *SourceElementType = GEPI->getSourceElementType(); in canReplaceGEPIdxWithZero()
859 for (unsigned i = Idx+1, e = GEPI->getNumOperands(); i != e; ++i) { in canReplaceGEPIdxWithZero()
860 KnownBits Known = IC.computeKnownBits(GEPI->getOperand(i), 0, MemI); in canReplaceGEPIdxWithZero()
874 if (Idx+1 != GEPI->getNumOperands() && !GEPI->isInBounds()) in canReplaceGEPIdxWithZero()
879 return isObjectSizeLessThanOrEq(GEPI->getOperand(0), TyAllocSize, DL) && in canReplaceGEPIdxWithZero()
889 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Ptr)) { in replaceGEPIdxWithZero() local
891 if (canReplaceGEPIdxWithZero(IC, GEPI, &MemI, Idx)) { in replaceGEPIdxWithZero()
892 Instruction *NewGEPI = GEPI->clone(); in replaceGEPIdxWithZero()
894 ConstantInt::get(GEPI->getOperand(Idx)->getType(), 0)); in replaceGEPIdxWithZero()
895 NewGEPI->insertBefore(GEPI); in replaceGEPIdxWithZero()
909 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Ptr)) in canSimplifyNullStoreOrGEP() local
910 Ptr = GEPI->getOperand(0); in canSimplifyNullStoreOrGEP()
916 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { in canSimplifyNullLoadOrGEP() local
917 const Value *GEPI0 = GEPI->getOperand(0); in canSimplifyNullLoadOrGEP()
919 !NullPointerIsDefined(LI.getFunction(), GEPI->getPointerAddressSpace())) in canSimplifyNullLoadOrGEP()