Lines Matching defs:GEPI

560   GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I);
561 if (GEPI == 0) return false;
563 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) ||
564 !cast<Constant>(GEPI->getOperand(1))->isNullValue())
567 for (Value::use_iterator I = GEPI->use_begin(), E = GEPI->use_end();
594 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U);
595 ++GEPI; // Skip over the pointer index.
598 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) {
615 for (++GEPI; // Skip array index.
616 GEPI != E;
617 ++GEPI) {
619 if (ArrayType *SubArrayTy = dyn_cast<ArrayType>(*GEPI))
621 else if (VectorType *SubVectorTy = dyn_cast<VectorType>(*GEPI))
624 assert((*GEPI)->isStructTy() &&
629 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand());
764 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
767 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i)
768 Idxs.push_back(GEPI->getOperand(i));
770 GEPI->getName()+"."+Twine(Val),GEPI);
775 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP))
776 GEPI->eraseFromParent();
826 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
827 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false;
906 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
909 Idxs.reserve(GEPI->getNumOperands()-1);
910 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end();
916 if (Idxs.size() == GEPI->getNumOperands()-1)
917 Changed |= OptimizeAwayTrappingUsesOfValue(GEPI,
919 if (GEPI->use_empty()) {
921 GEPI->eraseFromParent();
1219 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
1222 if (GEPI->hasAllZeroIndices() && GEPI->hasOneUse())
1223 if (StoreInst *SI = dyn_cast<StoreInst>(GEPI->use_back()))
1227 ReplaceUsesOfMallocWithGlobal(GEPI, GV);
1228 GEPI->eraseFromParent();
1259 if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(User)) {
1261 if (GEPI->getNumOperands() < 3)
1407 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(LoadUser)) {
1408 assert(GEPI->getNumOperands() >= 3 && isa<ConstantInt>(GEPI->getOperand(2))
1409 && "Unexpected GEPI!");
1412 unsigned FieldNo = cast<ConstantInt>(GEPI->getOperand(2))->getZExtValue();
1413 Value *NewPtr = GetHeapSROAValue(GEPI->getOperand(0), FieldNo,
1418 GEPIdx.push_back(GEPI->getOperand(1));
1419 GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end());
1422 GEPI->getName(), GEPI);
1423 GEPI->replaceAllUsesWith(NGEPI);
1424 GEPI->eraseFromParent();