From 90ef438f244ea9fdba63284b910e771b9d0192ad Mon Sep 17 00:00:00 2001 From: Michael Zolotukhin Date: Wed, 23 Sep 2015 23:12:43 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248444 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LoopUnroll.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Utils/LoopUnroll.cpp b/lib/Transforms/Utils/LoopUnroll.cpp index 971f01b72a1..95d31d86644 100644 --- a/lib/Transforms/Utils/LoopUnroll.cpp +++ b/lib/Transforms/Utils/LoopUnroll.cpp @@ -434,8 +434,9 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, // 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; } -- 2.34.1