Lines Matching refs:GEPI
395 GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I);
396 if (GEPI == 0) return false;
398 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) ||
399 !cast<Constant>(GEPI->getOperand(1))->isNullValue())
402 for (Value::use_iterator I = GEPI->use_begin(), E = GEPI->use_end();
429 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U);
430 ++GEPI; // Skip over the pointer index.
433 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) {
450 for (++GEPI; // Skip array index.
451 GEPI != E;
452 ++GEPI) {
454 if (ArrayType *SubArrayTy = dyn_cast<ArrayType>(*GEPI))
456 else if (VectorType *SubVectorTy = dyn_cast<VectorType>(*GEPI))
459 assert((*GEPI)->isStructTy() &&
464 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand());
602 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
605 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i)
606 Idxs.push_back(GEPI->getOperand(i));
608 GEPI->getName()+"."+Twine(Val),GEPI);
613 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP))
614 GEPI->eraseFromParent();
664 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
665 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false;
744 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
747 Idxs.reserve(GEPI->getNumOperands()-1);
748 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end();
754 if (Idxs.size() == GEPI->getNumOperands()-1)
755 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());
1250 GEPI->getName(), GEPI);
1251 GEPI->replaceAllUsesWith(NGEPI);
1252 GEPI->eraseFromParent();