[llvm] r248444 - [Unroll] When completely unrolling the loop, replace conditinal branches with unconditional.

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 16:12:44 PDT 2015


Author: mzolotukhin
Date: Wed Sep 23 18:12:43 2015
New Revision: 248444

URL: http://llvm.org/viewvc/llvm-project?rev=248444&view=rev
Log:
[Unroll] When completely unrolling the loop, replace conditinal branches with unconditional.

Nothing is expected to change, except we do less redundant work in
clean-up.

Reviewers: hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12951

Modified:
    llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp

Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=248444&r1=248443&r2=248444&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Wed Sep 23 18:12:43 2015
@@ -434,8 +434,9 @@ bool llvm::UnrollLoop(Loop *L, unsigned
 
     // For a complete unroll, make the last iteration end with a branch
     // to the exit block.
-    if (CompletelyUnroll && j == 0) {
-      Dest = LoopExit;
+    if (CompletelyUnroll) {
+      if (j == 0)
+        Dest = LoopExit;
       NeedConditional = false;
     }
 




More information about the llvm-commits mailing list