• Home
  • Raw
  • Download

Lines Matching refs:GEPI

337   GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I);  in isSafeSROAElementUse()  local
338 if (!GEPI) return false; in isSafeSROAElementUse()
340 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) || in isSafeSROAElementUse()
341 !cast<Constant>(GEPI->getOperand(1))->isNullValue()) in isSafeSROAElementUse()
344 for (User *U : GEPI->users()) in isSafeSROAElementUse()
369 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in IsUserOfGlobalSafeForSRA() local
370 ++GEPI; // Skip over the pointer index. in IsUserOfGlobalSafeForSRA()
373 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) { in IsUserOfGlobalSafeForSRA()
390 for (++GEPI; // Skip array index. in IsUserOfGlobalSafeForSRA()
391 GEPI != E; in IsUserOfGlobalSafeForSRA()
392 ++GEPI) { in IsUserOfGlobalSafeForSRA()
394 if (ArrayType *SubArrayTy = dyn_cast<ArrayType>(*GEPI)) in IsUserOfGlobalSafeForSRA()
396 else if (VectorType *SubVectorTy = dyn_cast<VectorType>(*GEPI)) in IsUserOfGlobalSafeForSRA()
399 assert((*GEPI)->isStructTy() && in IsUserOfGlobalSafeForSRA()
404 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand()); in IsUserOfGlobalSafeForSRA()
544 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP); in SRAGlobal() local
547 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) in SRAGlobal()
548 Idxs.push_back(GEPI->getOperand(i)); in SRAGlobal()
550 NewTy, NewPtr, Idxs, GEPI->getName() + "." + Twine(Val), GEPI); in SRAGlobal()
555 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP)) in SRAGlobal() local
556 GEPI->eraseFromParent(); in SRAGlobal()
603 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in AllUsesOfValueWillTrapIfNull() local
604 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false; in AllUsesOfValueWillTrapIfNull()
679 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in OptimizeAwayTrappingUsesOfValue() local
682 Idxs.reserve(GEPI->getNumOperands()-1); in OptimizeAwayTrappingUsesOfValue()
683 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end(); in OptimizeAwayTrappingUsesOfValue()
689 if (Idxs.size() == GEPI->getNumOperands()-1) in OptimizeAwayTrappingUsesOfValue()
691 GEPI, ConstantExpr::getGetElementPtr(nullptr, NewV, Idxs)); in OptimizeAwayTrappingUsesOfValue()
692 if (GEPI->use_empty()) { in OptimizeAwayTrappingUsesOfValue()
694 GEPI->eraseFromParent(); in OptimizeAwayTrappingUsesOfValue()
985 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in ReplaceUsesOfMallocWithGlobal() local
988 if (GEPI->hasAllZeroIndices() && GEPI->hasOneUse()) in ReplaceUsesOfMallocWithGlobal()
989 if (StoreInst *SI = dyn_cast<StoreInst>(GEPI->user_back())) in ReplaceUsesOfMallocWithGlobal()
993 ReplaceUsesOfMallocWithGlobal(GEPI, GV); in ReplaceUsesOfMallocWithGlobal()
994 GEPI->eraseFromParent(); in ReplaceUsesOfMallocWithGlobal()
1024 if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(UI)) { in LoadUsesSimpleEnoughForHeapSRA() local
1026 if (GEPI->getNumOperands() < 3) in LoadUsesSimpleEnoughForHeapSRA()
1170 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(LoadUser)) { in RewriteHeapSROALoadUser() local
1171 assert(GEPI->getNumOperands() >= 3 && isa<ConstantInt>(GEPI->getOperand(2)) in RewriteHeapSROALoadUser()
1175 unsigned FieldNo = cast<ConstantInt>(GEPI->getOperand(2))->getZExtValue(); in RewriteHeapSROALoadUser()
1176 Value *NewPtr = GetHeapSROAValue(GEPI->getOperand(0), FieldNo, in RewriteHeapSROALoadUser()
1181 GEPIdx.push_back(GEPI->getOperand(1)); in RewriteHeapSROALoadUser()
1182 GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end()); in RewriteHeapSROALoadUser()
1184 Value *NGEPI = GetElementPtrInst::Create(GEPI->getResultElementType(), NewPtr, GEPIdx, in RewriteHeapSROALoadUser()
1185 GEPI->getName(), GEPI); in RewriteHeapSROALoadUser()
1186 GEPI->replaceAllUsesWith(NGEPI); in RewriteHeapSROALoadUser()
1187 GEPI->eraseFromParent(); in RewriteHeapSROALoadUser()