BlockFrequencyInfo *BFI, const Loop *CurLoop,
ICFLoopSafetyInfo *SafetyInfo, MemorySSAUpdater *MSSAU,
OptimizationRemarkEmitter *ORE) {
- LLVM_DEBUG(dbgs() << "LICM sinking instruction: " << I << "\n");
- ORE->emit([&]() {
- return OptimizationRemark(DEBUG_TYPE, "InstSunk", &I)
- << "sinking " << ore::NV("Inst", &I);
- });
bool Changed = false;
- if (isa<LoadInst>(I))
- ++NumMovedLoads;
- else if (isa<CallInst>(I))
- ++NumMovedCalls;
- ++NumSunk;
+ LLVM_DEBUG(dbgs() << "LICM sinking instruction: " << I << "\n");
// Iterate over users to be ready for actual sinking. Replace users via
// unreachable blocks with undef and make all user PHIs trivially replaceable.
if (VisitedUsers.empty())
return Changed;
+ ORE->emit([&]() {
+ return OptimizationRemark(DEBUG_TYPE, "InstSunk", &I)
+ << "sinking " << ore::NV("Inst", &I);
+ });
+ if (isa<LoadInst>(I))
+ ++NumMovedLoads;
+ else if (isa<CallInst>(I))
+ ++NumMovedCalls;
+ ++NumSunk;
+
#ifndef NDEBUG
SmallVector<BasicBlock *, 32> ExitBlocks;
CurLoop->getUniqueExitBlocks(ExitBlocks);