Lines Matching refs:GEPI
832 GetElementPtrInst *GEPI, Instruction *MemI, in canReplaceGEPIdxWithZero() argument
834 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
839 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
841 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
842 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
855 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
856 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
858 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
861 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
862 Type *SourceElementType = GEPI->getSourceElementType(); in canReplaceGEPIdxWithZero()
879 for (unsigned i = Idx+1, e = GEPI->getNumOperands(); i != e; ++i) { in canReplaceGEPIdxWithZero()
880 KnownBits Known = IC.computeKnownBits(GEPI->getOperand(i), 0, MemI); in canReplaceGEPIdxWithZero()
894 if (Idx+1 != GEPI->getNumOperands() && !GEPI->isInBounds()) in canReplaceGEPIdxWithZero()
899 return isObjectSizeLessThanOrEq(GEPI->getOperand(0), TyAllocSize, DL) && in canReplaceGEPIdxWithZero()
909 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Ptr)) { in replaceGEPIdxWithZero() local
911 if (canReplaceGEPIdxWithZero(IC, GEPI, &MemI, Idx)) { in replaceGEPIdxWithZero()
912 Instruction *NewGEPI = GEPI->clone(); in replaceGEPIdxWithZero()
914 ConstantInt::get(GEPI->getOperand(Idx)->getType(), 0)); in replaceGEPIdxWithZero()
915 NewGEPI->insertBefore(GEPI); in replaceGEPIdxWithZero()
929 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Ptr)) in canSimplifyNullStoreOrGEP() local
930 Ptr = GEPI->getOperand(0); in canSimplifyNullStoreOrGEP()
936 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { in canSimplifyNullLoadOrGEP() local
937 const Value *GEPI0 = GEPI->getOperand(0); in canSimplifyNullLoadOrGEP()
939 !NullPointerIsDefined(LI.getFunction(), GEPI->getPointerAddressSpace())) in canSimplifyNullLoadOrGEP()