[PATCH] D44667: [LoopPredication] Add profitability check based on BPI
    Serguei Katkov via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Mar 20 01:20:54 PDT 2018
    
    
  
skatkov added inline comments.
================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:740
+  // within the loop.
+  auto ProfitableToPredicate = [&]() {
+    if (SkipProfitabilityChecks || !BPI)
----------------
I'm not against lambda, but don't you think that this big code would be better to put in the separate method of LoopPredication?
================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:765
+      // loop is larger than LatchExitProbability, it's not profitable to predicate.
+      if (ExitingBlockProbability > LatchExitProbability)
+        return false;
----------------
Don't you want to introduce some delta? Usually branch probability is something is better to compare with some delta.
Repository:
  rL LLVM
https://reviews.llvm.org/D44667
    
    
More information about the llvm-commits
mailing list