Lines Matching refs:LI
182 void RewriteLoadUserOfWholeAlloca(LoadInst *LI, AllocaInst *AI,
472 if (LoadInst *LI = dyn_cast<LoadInst>(User)) { in CanConvertToScalar() local
474 if (!LI->isSimple()) in CanConvertToScalar()
477 if (LI->getType()->isX86_MMXTy()) in CanConvertToScalar()
480 MergeInTypeForLoadOrStore(LI->getType(), Offset); in CanConvertToScalar()
627 if (LoadInst *LI = dyn_cast<LoadInst>(User)) { in ConvertUsesToScalar() local
631 = ConvertScalar_ExtractValue(LoadedVal, LI->getType(), Offset, in ConvertUsesToScalar()
633 LI->replaceAllUsesWith(NewLoadVal); in ConvertUsesToScalar()
634 LI->eraseFromParent(); in ConvertUsesToScalar()
1083 if (LoadInst *LI = dyn_cast<LoadInst>(I)) in isInstInList() local
1084 return LI->getOperand(0) == AI; in isInstInList()
1094 else if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) in updateDebugInfo() local
1095 ConvertDebugDeclareToDebugValue(DDI, LI, *DIB); in updateDebugInfo()
1110 } else if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) { in updateDebugInfo() local
1111 Arg = LI->getOperand(0); in updateDebugInfo()
1143 LoadInst *LI = dyn_cast<LoadInst>(*UI); in isSafeSelectToSpeculate() local
1144 if (LI == 0 || !LI->isSimple()) return false; in isSafeSelectToSpeculate()
1148 if (!TDerefable && !isSafeToLoadUnconditionally(SI->getTrueValue(), LI, in isSafeSelectToSpeculate()
1149 LI->getAlignment(), TD)) in isSafeSelectToSpeculate()
1151 if (!FDerefable && !isSafeToLoadUnconditionally(SI->getFalseValue(), LI, in isSafeSelectToSpeculate()
1152 LI->getAlignment(), TD)) in isSafeSelectToSpeculate()
1184 LoadInst *LI = dyn_cast<LoadInst>(*UI); in isSafePHIToSpeculate() local
1185 if (LI == 0 || !LI->isSimple()) return false; in isSafePHIToSpeculate()
1189 if (LI->getParent() != BB) return false; in isSafePHIToSpeculate()
1193 for (BasicBlock::iterator BBI = PN; &*BBI != LI; ++BBI) in isSafePHIToSpeculate()
1197 MaxAlign = std::max(MaxAlign, LI->getAlignment()); in isSafePHIToSpeculate()
1246 if (LoadInst *LI = dyn_cast<LoadInst>(U)) { in tryToMakeAllocaBePromotable() local
1247 if (!LI->isSimple()) in tryToMakeAllocaBePromotable()
1329 LoadInst *LI = cast<LoadInst>(SI->use_back()); in tryToMakeAllocaBePromotable() local
1331 IRBuilder<> Builder(LI); in tryToMakeAllocaBePromotable()
1333 Builder.CreateLoad(SI->getTrueValue(), LI->getName()+".t"); in tryToMakeAllocaBePromotable()
1335 Builder.CreateLoad(SI->getFalseValue(), LI->getName()+".f"); in tryToMakeAllocaBePromotable()
1338 TrueLoad->setAlignment(LI->getAlignment()); in tryToMakeAllocaBePromotable()
1339 FalseLoad->setAlignment(LI->getAlignment()); in tryToMakeAllocaBePromotable()
1340 if (MDNode *Tag = LI->getMetadata(LLVMContext::MD_tbaa)) { in tryToMakeAllocaBePromotable()
1346 V->takeName(LI); in tryToMakeAllocaBePromotable()
1347 LI->replaceAllUsesWith(V); in tryToMakeAllocaBePromotable()
1348 LI->eraseFromParent(); in tryToMakeAllocaBePromotable()
1376 LoadInst *LI = cast<LoadInst>(PN->use_back()); in tryToMakeAllocaBePromotable() local
1377 LI->replaceAllUsesWith(NewPN); in tryToMakeAllocaBePromotable()
1378 LI->eraseFromParent(); in tryToMakeAllocaBePromotable()
1621 } else if (LoadInst *LI = dyn_cast<LoadInst>(User)) { in isSafeForScalarRepl() local
1622 if (!LI->isSimple()) in isSafeForScalarRepl()
1624 Type *LIType = LI->getType(); in isSafeForScalarRepl()
1626 LIType, false, Info, LI, true /*AllowWholeAccess*/); in isSafeForScalarRepl()
1680 } else if (LoadInst *LI = dyn_cast<LoadInst>(User)) { in isSafePHISelectUseForScalarRepl() local
1681 if (!LI->isSimple()) in isSafePHISelectUseForScalarRepl()
1683 Type *LIType = LI->getType(); in isSafePHISelectUseForScalarRepl()
1685 LIType, false, Info, LI, false /*AllowWholeAccess*/); in isSafePHISelectUseForScalarRepl()
1902 if (LoadInst *LI = dyn_cast<LoadInst>(User)) { in RewriteForScalarRepl() local
1903 Type *LIType = LI->getType(); in RewriteForScalarRepl()
1915 IRBuilder<> Builder(LI); in RewriteForScalarRepl()
1920 LI->replaceAllUsesWith(Insert); in RewriteForScalarRepl()
1921 DeadInsts.push_back(LI); in RewriteForScalarRepl()
1926 RewriteLoadUserOfWholeAlloca(LI, AI, NewElts); in RewriteForScalarRepl()
2446 SROA::RewriteLoadUserOfWholeAlloca(LoadInst *LI, AllocaInst *AI, in RewriteLoadUserOfWholeAlloca() argument
2453 DEBUG(dbgs() << "PROMOTING LOAD OF WHOLE ALLOCA: " << *AI << '\n' << *LI in RewriteLoadUserOfWholeAlloca()
2468 Constant::getNullValue(IntegerType::get(LI->getContext(), AllocaSizeBits)); in RewriteLoadUserOfWholeAlloca()
2481 IntegerType *FieldIntTy = IntegerType::get(LI->getContext(), in RewriteLoadUserOfWholeAlloca()
2487 "", LI); in RewriteLoadUserOfWholeAlloca()
2488 SrcField = new LoadInst(SrcField, "sroa.load.elt", LI); in RewriteLoadUserOfWholeAlloca()
2493 SrcField = new BitCastInst(SrcField, FieldIntTy, "", LI); in RewriteLoadUserOfWholeAlloca()
2498 SrcField = new ZExtInst(SrcField, ResultVal->getType(), "", LI); in RewriteLoadUserOfWholeAlloca()
2512 SrcField = BinaryOperator::CreateShl(SrcField, ShiftVal, "", LI); in RewriteLoadUserOfWholeAlloca()
2518 ResultVal = BinaryOperator::CreateOr(SrcField, ResultVal, "", LI); in RewriteLoadUserOfWholeAlloca()
2524 if (TD->getTypeSizeInBits(LI->getType()) != AllocaSizeBits) in RewriteLoadUserOfWholeAlloca()
2525 ResultVal = new TruncInst(ResultVal, LI->getType(), "", LI); in RewriteLoadUserOfWholeAlloca()
2527 LI->replaceAllUsesWith(ResultVal); in RewriteLoadUserOfWholeAlloca()
2528 DeadInsts.push_back(LI); in RewriteLoadUserOfWholeAlloca()