Lines Matching refs:GEPI
397 GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I);
398 if (GEPI == 0) return false;
400 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) ||
401 !cast<Constant>(GEPI->getOperand(1))->isNullValue())
404 for (Value::use_iterator I = GEPI->use_begin(), E = GEPI->use_end();
431 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U);
432 ++GEPI; // Skip over the pointer index.
435 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) {
452 for (++GEPI; // Skip array index.
453 GEPI != E;
454 ++GEPI) {
456 if (ArrayType *SubArrayTy = dyn_cast<ArrayType>(*GEPI))
458 else if (VectorType *SubVectorTy = dyn_cast<VectorType>(*GEPI))
461 assert((*GEPI)->isStructTy() &&
466 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand());
603 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
606 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i)
607 Idxs.push_back(GEPI->getOperand(i));
609 GEPI->getName()+"."+Twine(Val),GEPI);
614 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP))
615 GEPI->eraseFromParent();
665 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
666 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false;
745 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
748 Idxs.reserve(GEPI->getNumOperands()-1);
749 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end();
755 if (Idxs.size() == GEPI->getNumOperands()-1)
756 Changed |= OptimizeAwayTrappingUsesOfValue(GEPI,
758 if (GEPI->use_empty()) {
760 GEPI->eraseFromParent();
1045 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
1048 if (GEPI->hasAllZeroIndices() && GEPI->hasOneUse())
1049 if (StoreInst *SI = dyn_cast<StoreInst>(GEPI->use_back()))
1053 ReplaceUsesOfMallocWithGlobal(GEPI, GV);
1054 GEPI->eraseFromParent();
1085 if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(User)) {
1087 if (GEPI->getNumOperands() < 3)
1234 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(LoadUser)) {
1235 assert(GEPI->getNumOperands() >= 3 && isa<ConstantInt>(GEPI->getOperand(2))
1236 && "Unexpected GEPI!");
1239 unsigned FieldNo = cast<ConstantInt>(GEPI->getOperand(2))->getZExtValue();
1240 Value *NewPtr = GetHeapSROAValue(GEPI->getOperand(0), FieldNo,
1245 GEPIdx.push_back(GEPI->getOperand(1));
1246 GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end());
1249 GEPI->getName(), GEPI);
1250 GEPI->replaceAllUsesWith(NGEPI);
1251 GEPI->eraseFromParent();