Lines Matching defs:GEPI
1095 void visitGetElementPtrInst(GetElementPtrInst &GEPI) {
1096 if (GEPI.use_empty())
1097 return markAsDead(GEPI);
1099 return Base::visitGetElementPtrInst(GEPI);
3992 bool unfoldGEPSelect(GetElementPtrInst &GEPI) {
3995 SelectInst *Sel = dyn_cast<SelectInst>(GEPI.getPointerOperand());
3996 for (Value *Op : GEPI.indices()) {
4017 dbgs() << " " << GEPI << "\n";);
4021 for (Value *Op : GEPI.operands())
4034 IRB.SetInsertPoint(&GEPI);
4035 GEPNoWrapFlags NW = GEPI.getNoWrapFlags();
4037 Type *Ty = GEPI.getSourceElementType();
4047 Visited.erase(&GEPI);
4048 GEPI.replaceAllUsesWith(NSel);
4049 GEPI.eraseFromParent();
4065 bool unfoldGEPPhi(GetElementPtrInst &GEPI) {
4069 PHINode *Phi = dyn_cast<PHINode>(GEPI.getPointerOperand());
4081 if (IsInvalidPointerOperand(GEPI.getPointerOperand()))
4086 for (Value *Op : GEPI.indices()) {
4107 dbgs() << " " << GEPI << "\n";);
4111 for (Value *Op : GEPI.operands())
4120 PHINode *NewPhi = IRB.CreatePHI(GEPI.getType(), Phi->getNumIncomingValues(),
4123 Type *SourceTy = GEPI.getSourceElementType();
4126 IRB.SetInsertPoint(GEPI.getFunction()->getEntryBlock().getTerminator());
4137 Phi->getName() + ".sroa.gep", GEPI.getNoWrapFlags());
4142 Visited.erase(&GEPI);
4143 GEPI.replaceAllUsesWith(NewPhi);
4144 GEPI.eraseFromParent();
4157 bool visitGetElementPtrInst(GetElementPtrInst &GEPI) {
4158 if (unfoldGEPSelect(GEPI))
4161 if (unfoldGEPPhi(GEPI))
4164 enqueueUsers(GEPI);