[PATCH] D27911: [LoopUnroll] Keep UP.Count when considering complete unroll

Z. Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 17:58:07 PST 2017


zzheng updated this revision to Diff 83759.
zzheng added a comment.

Moved UP.Count = FullUnrollTripCount under condition as suggested by Evgeny.


Repository:
  rL LLVM

https://reviews.llvm.org/D27911

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp


Index: lib/Transforms/Scalar/LoopUnrollPass.cpp
===================================================================
--- lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -742,8 +742,8 @@
   assert((ExactTripCount == 0 || MaxTripCount == 0) &&
          "ExtractTripCound and MaxTripCount cannot both be non zero.");
   unsigned FullUnrollTripCount = ExactTripCount ? ExactTripCount : MaxTripCount;
-  UP.Count = FullUnrollTripCount;
   if (FullUnrollTripCount && FullUnrollTripCount <= UP.FullUnrollMaxCount) {
+    UP.Count = FullUnrollTripCount;
     // When computing the unrolled size, note that BEInsns are not replicated
     // like the rest of the loop body.
     if (getUnrolledLoopSize(LoopSize, UP) < UP.Threshold) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27911.83759.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/3365d3a2/attachment.bin>


More information about the llvm-commits mailing list