Lines Matching refs:LI
67 if (const LoadInst *LI = dyn_cast<LoadInst>(U)) { in isAllocaPromotable() local
70 if (LI->isVolatile() || LI->getType() != AI->getAllocatedType()) in isAllocaPromotable()
252 LoadInst *LI = cast<LoadInst>(User); in AnalyzeAlloca() local
255 UsingBlocks.push_back(LI->getParent()); in AnalyzeAlloca()
441 static void addAssumeNonNull(AssumptionCache *AC, LoadInst *LI) { in addAssumeNonNull() argument
443 Intrinsic::getDeclaration(LI->getModule(), Intrinsic::assume); in addAssumeNonNull()
444 ICmpInst *LoadNotNull = new ICmpInst(ICmpInst::ICMP_NE, LI, in addAssumeNonNull()
445 Constant::getNullValue(LI->getType())); in addAssumeNonNull()
446 LoadNotNull->insertAfter(LI); in addAssumeNonNull()
452 static void convertMetadataToAssumes(LoadInst *LI, Value *Val, in convertMetadataToAssumes() argument
459 if (AC && LI->getMetadata(LLVMContext::MD_nonnull) && in convertMetadataToAssumes()
460 LI->getMetadata(LLVMContext::MD_noundef) && in convertMetadataToAssumes()
461 !isKnownNonZero(Val, DL, 0, AC, LI, DT)) in convertMetadataToAssumes()
462 addAssumeNonNull(AC, LI); in convertMetadataToAssumes()
525 LoadInst *LI = cast<LoadInst>(UserInst); in rewriteSingleStoreAlloca() local
532 if (LI->getParent() == StoreBB) { in rewriteSingleStoreAlloca()
539 if (unsigned(StoreIndex) > LBI.getInstructionIndex(LI)) { in rewriteSingleStoreAlloca()
544 } else if (!DT.dominates(StoreBB, LI->getParent())) { in rewriteSingleStoreAlloca()
548 Info.UsingBlocks.push_back(LI->getParent()); in rewriteSingleStoreAlloca()
557 if (ReplVal == LI) in rewriteSingleStoreAlloca()
558 ReplVal = PoisonValue::get(LI->getType()); in rewriteSingleStoreAlloca()
560 convertMetadataToAssumes(LI, ReplVal, DL, AC, &DT); in rewriteSingleStoreAlloca()
561 LI->replaceAllUsesWith(ReplVal); in rewriteSingleStoreAlloca()
562 LI->eraseFromParent(); in rewriteSingleStoreAlloca()
563 LBI.deleteValue(LI); in rewriteSingleStoreAlloca()
643 LoadInst *LI = dyn_cast<LoadInst>(U); in promoteSingleBlockAlloca() local
644 if (!LI) in promoteSingleBlockAlloca()
647 unsigned LoadIdx = LBI.getInstructionIndex(LI); in promoteSingleBlockAlloca()
658 ReplVal = UndefValue::get(LI->getType()); in promoteSingleBlockAlloca()
669 convertMetadataToAssumes(LI, ReplVal, DL, AC, &DT); in promoteSingleBlockAlloca()
673 if (ReplVal == LI) in promoteSingleBlockAlloca()
674 ReplVal = PoisonValue::get(LI->getType()); in promoteSingleBlockAlloca()
676 LI->replaceAllUsesWith(ReplVal); in promoteSingleBlockAlloca()
677 LI->eraseFromParent(); in promoteSingleBlockAlloca()
678 LBI.deleteValue(LI); in promoteSingleBlockAlloca()
1011 if (LoadInst *LI = dyn_cast<LoadInst>(I)) in ComputeLiveInBlocks() local
1014 if (LI->getOperand(0) == AI) in ComputeLiveInBlocks()
1145 if (LoadInst *LI = dyn_cast<LoadInst>(I)) { in RenamePass() local
1146 AllocaInst *Src = dyn_cast<AllocaInst>(LI->getPointerOperand()); in RenamePass()
1155 convertMetadataToAssumes(LI, V, SQ.DL, AC, &DT); in RenamePass()
1158 LI->replaceAllUsesWith(V); in RenamePass()
1159 LI->eraseFromParent(); in RenamePass()