[PATCH] D29016: [LoopUnswitch] Do not freeze condition if hoisted branch is guaranteed to be reachable

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 00:07:56 PST 2017


aqjune added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:631
+    // is needed.
+    bool NeedFreeze = true;
+    {
----------------
efriedma wrote:
> Maybe we should be a little more aggressive here?  LoopUnswitch::TryTrivialLoopUnswitch has a branch-following loop which special-cases conditional branches with a constant condition.
> 
> Can we compute this once for the whole loop, rather than iterating over the whole loop for each basic block?
@efriedma  Hello. I couldn't understand your comment. Do you mean we can cache the necessity of freeze when LoopUnswitch::TryTrivialLoopUnswitch is called (which is called at line 545), and then reuse the cached info here?


https://reviews.llvm.org/D29016





More information about the llvm-commits mailing list