[PATCH] D23891: [LoopUnroll] Check partial unrolling is enabled before initialization. NFC.

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 12:53:01 PDT 2016


haicheng updated this revision to Diff 69287.
haicheng added a comment.

Update the correct patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D23891

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp

Index: lib/Transforms/Scalar/LoopUnrollPass.cpp
===================================================================
--- lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -779,15 +779,15 @@
   // 4rd priority is partial unrolling.
   // Try partial unroll only when TripCount could be staticaly calculated.
   if (TripCount) {
-    if (UP.Count == 0)
-      UP.Count = TripCount;
     UP.Partial |= ExplicitUnroll;
     if (!UP.Partial) {
       DEBUG(dbgs() << "  will not try to unroll partially because "
                    << "-unroll-allow-partial not given\n");
       UP.Count = 0;
       return false;
     }
+    if (UP.Count == 0)
+      UP.Count = TripCount;
     if (UP.PartialThreshold != NoThreshold) {
       // Reduce unroll count to be modulo of TripCount for partial unrolling.
       UnrolledSize = (uint64_t)(LoopSize - BEInsns) * UP.Count + BEInsns;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23891.69287.patch
Type: text/x-patch
Size: 910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160825/d7f33a7b/attachment.bin>


More information about the llvm-commits mailing list