Lines Matching refs:Malloc
1740 auto *Malloc = const_cast<CallInst *>(dyn_cast<CallInst>(DefUO)); in tryFoldIntoCalloc() local
1741 if (!Malloc) in tryFoldIntoCalloc()
1743 auto *InnerCallee = Malloc->getCalledFunction(); in tryFoldIntoCalloc()
1751 auto shouldCreateCalloc = [](CallInst *Malloc, CallInst *Memset) { in tryFoldIntoCalloc() argument
1754 auto *MallocBB = Malloc->getParent(), in tryFoldIntoCalloc()
1770 if (Malloc->getOperand(0) != MemSet->getLength()) in tryFoldIntoCalloc()
1772 if (!shouldCreateCalloc(Malloc, MemSet) || in tryFoldIntoCalloc()
1773 !DT.dominates(Malloc, MemSet) || in tryFoldIntoCalloc()
1774 !memoryIsNotModifiedBetween(Malloc, MemSet, BatchAA, DL, &DT)) in tryFoldIntoCalloc()
1776 IRBuilder<> IRB(Malloc); in tryFoldIntoCalloc()
1777 const auto &DL = Malloc->getModule()->getDataLayout(); in tryFoldIntoCalloc()
1780 Malloc->getArgOperand(0), IRB, TLI); in tryFoldIntoCalloc()
1785 cast<MemoryDef>(Updater.getMemorySSA()->getMemoryAccess(Malloc)); in tryFoldIntoCalloc()
1791 Updater.removeMemoryAccess(Malloc); in tryFoldIntoCalloc()
1792 Malloc->replaceAllUsesWith(Calloc); in tryFoldIntoCalloc()
1793 Malloc->eraseFromParent(); in tryFoldIntoCalloc()