[PATCH] D26299: Improving the efficiency of the Loop Unswitching pass

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 14:24:44 PST 2016


anna added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:510
+    BasicBlockEdge UnreachableEdge(BInst->getParent(), UnreachableSucc);
+    if (DT->dominates(UnreachableEdge, BB)) {
+      return true;
----------------
Prior diff question:
Isn't it enough to check if the basic block UnreachableSucc dominates I->getParent()?
i.e. `DT->dominates(UnreachableSucc, BB). 
Is there something else subtle here, that I'm missing?
IIUC, the algorithm keeps traversing backwards to an immediate dominator of the current `DomBB`, and checks if it's an unreachable block. 



================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:512
+      return true;
+    }
+  }
----------------
Is this clang-formatted? I think single statements within if-conditions dont need braces.



Repository:
  rL LLVM

https://reviews.llvm.org/D26299





More information about the llvm-commits mailing list