Home | History | Annotate | Download | only in IPO

Lines Matching refs:GEPI

374   GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I);
375 if (!GEPI) return false;
377 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) ||
378 !cast<Constant>(GEPI->getOperand(1))->isNullValue())
381 for (User *U : GEPI->users())
407 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U);
408 ++GEPI; // Skip over the pointer index.
411 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) {
428 for (++GEPI; // Skip array index.
429 GEPI != E;
430 ++GEPI) {
432 if (ArrayType *SubArrayTy = dyn_cast<ArrayType>(*GEPI))
434 else if (VectorType *SubVectorTy = dyn_cast<VectorType>(*GEPI))
437 assert((*GEPI)->isStructTy() &&
442 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand());
580 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
583 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i)
584 Idxs.push_back(GEPI->getOperand(i));
587 GEPI->getName() + "." + Twine(Val), GEPI);
592 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP))
593 GEPI->eraseFromParent();
640 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
641 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false;
716 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
719 Idxs.reserve(GEPI->getNumOperands()-1);
720 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end();
726 if (Idxs.size() == GEPI->getNumOperands()-1)
728 GEPI, ConstantExpr::getGetElementPtr(nullptr, NewV, Idxs));
729 if (GEPI->use_empty()) {
731 GEPI->eraseFromParent();
1028 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) {
1031 if (GEPI->hasAllZeroIndices() && GEPI->hasOneUse())
1032 if (StoreInst *SI = dyn_cast<StoreInst>(GEPI->user_back()))
1036 ReplaceUsesOfMallocWithGlobal(GEPI, GV);
1037 GEPI->eraseFromParent();
1067 if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(UI)) {
1069 if (GEPI->getNumOperands() < 3)
1213 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(LoadUser)) {
1214 assert(GEPI->getNumOperands() >= 3 && isa<ConstantInt>(GEPI->getOperand(2))
1215 && "Unexpected GEPI!");
1218 unsigned FieldNo = cast<ConstantInt>(GEPI->getOperand(2))->getZExtValue();
1219 Value *NewPtr = GetHeapSROAValue(GEPI->getOperand(0), FieldNo,
1224 GEPIdx.push_back(GEPI->getOperand(1));
1225 GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end());
1227 Value *NGEPI = GetElementPtrInst::Create(GEPI->getResultElementType(), NewPtr, GEPIdx,
1228 GEPI->getName(), GEPI);
1229 GEPI->replaceAllUsesWith(NGEPI);
1230 GEPI->eraseFromParent();