[PATCH] D19950: Use frequency info to guide Loop Invariant Code Motion.

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 21:15:43 PDT 2016


davidxl added inline comments.

================
Comment at: lib/Transforms/Scalar/LICM.cpp:357
@@ -346,3 +356,3 @@
   bool Changed = false;
   if (!inSubLoop(BB, CurLoop, LI))
     for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E;) {
----------------
Better to do this:

if (ShouldHoist && !inSubLoop(BB, CurLoop, LI)) 


Chad's suggestion of doing 

ShouldHoist = BFI->getBlockFreq(BB) >= .. is also good.


http://reviews.llvm.org/D19950





More information about the llvm-commits mailing list