Lines Matching refs:LI
66 if (const LoadInst *LI = dyn_cast<LoadInst>(U)) { in isAllocaPromotable() local
69 if (LI->isVolatile() || LI->getType() != AI->getAllocatedType()) in isAllocaPromotable()
140 LoadInst *LI = cast<LoadInst>(User); in AnalyzeAlloca() local
143 UsingBlocks.push_back(LI->getParent()); in AnalyzeAlloca()
301 static void addAssumeNonNull(AssumptionCache *AC, LoadInst *LI) { in addAssumeNonNull() argument
303 Intrinsic::getDeclaration(LI->getModule(), Intrinsic::assume); in addAssumeNonNull()
304 ICmpInst *LoadNotNull = new ICmpInst(ICmpInst::ICMP_NE, LI, in addAssumeNonNull()
305 Constant::getNullValue(LI->getType())); in addAssumeNonNull()
306 LoadNotNull->insertAfter(LI); in addAssumeNonNull()
369 LoadInst *LI = cast<LoadInst>(UserInst); in rewriteSingleStoreAlloca() local
376 if (LI->getParent() == StoreBB) { in rewriteSingleStoreAlloca()
383 if (unsigned(StoreIndex) > LBI.getInstructionIndex(LI)) { in rewriteSingleStoreAlloca()
388 } else if (!DT.dominates(StoreBB, LI->getParent())) { in rewriteSingleStoreAlloca()
392 Info.UsingBlocks.push_back(LI->getParent()); in rewriteSingleStoreAlloca()
401 if (ReplVal == LI) in rewriteSingleStoreAlloca()
402 ReplVal = PoisonValue::get(LI->getType()); in rewriteSingleStoreAlloca()
407 if (AC && LI->getMetadata(LLVMContext::MD_nonnull) && in rewriteSingleStoreAlloca()
408 !isKnownNonZero(ReplVal, DL, 0, AC, LI, &DT)) in rewriteSingleStoreAlloca()
409 addAssumeNonNull(AC, LI); in rewriteSingleStoreAlloca()
411 LI->replaceAllUsesWith(ReplVal); in rewriteSingleStoreAlloca()
412 LI->eraseFromParent(); in rewriteSingleStoreAlloca()
413 LBI.deleteValue(LI); in rewriteSingleStoreAlloca()
480 LoadInst *LI = dyn_cast<LoadInst>(U); in promoteSingleBlockAlloca() local
481 if (!LI) in promoteSingleBlockAlloca()
484 unsigned LoadIdx = LBI.getInstructionIndex(LI); in promoteSingleBlockAlloca()
495 ReplVal = UndefValue::get(LI->getType()); in promoteSingleBlockAlloca()
508 if (AC && LI->getMetadata(LLVMContext::MD_nonnull) && in promoteSingleBlockAlloca()
509 !isKnownNonZero(ReplVal, DL, 0, AC, LI, &DT)) in promoteSingleBlockAlloca()
510 addAssumeNonNull(AC, LI); in promoteSingleBlockAlloca()
514 if (ReplVal == LI) in promoteSingleBlockAlloca()
515 ReplVal = PoisonValue::get(LI->getType()); in promoteSingleBlockAlloca()
517 LI->replaceAllUsesWith(ReplVal); in promoteSingleBlockAlloca()
518 LI->eraseFromParent(); in promoteSingleBlockAlloca()
519 LBI.deleteValue(LI); in promoteSingleBlockAlloca()
820 if (LoadInst *LI = dyn_cast<LoadInst>(I)) in ComputeLiveInBlocks() local
823 if (LI->getOperand(0) == AI) in ComputeLiveInBlocks()
949 if (LoadInst *LI = dyn_cast<LoadInst>(I)) { in RenamePass() local
950 AllocaInst *Src = dyn_cast<AllocaInst>(LI->getPointerOperand()); in RenamePass()
963 if (AC && LI->getMetadata(LLVMContext::MD_nonnull) && in RenamePass()
964 !isKnownNonZero(V, SQ.DL, 0, AC, LI, &DT)) in RenamePass()
965 addAssumeNonNull(AC, LI); in RenamePass()
968 LI->replaceAllUsesWith(V); in RenamePass()
969 BB->getInstList().erase(LI); in RenamePass()