[PATCH] D18158: Adding ability to unroll loops using epilogue remainder.

Evgeny Stupachenko via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 19:53:56 PDT 2016


evstupac added inline comments.

================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:543-544
@@ -347,3 +542,4 @@
                                             PreHeaderBR);
-  Value *BECount = Expander.expandCodeFor(BECountSC, BECountSC->getType(),
+  Value *BECount = UseEpilogRemainder ? nullptr :
+                   Expander.expandCodeFor(BECountSC, BECountSC->getType(),
                                           PreHeaderBR);
----------------
mzolotukhin wrote:
> Maybe expand it just before the actual use?
Since TripCount is BECount + 1 it would be easier for combiner to optimize them when they are close.
BECount expanded here before my changes. For epilog remainder I don't need it.
Also when we add runtime unroll with non-power-of-2 factors we'll need BECount for extra iteration (for non-power-of-2 cases).


Repository:
  rL LLVM

http://reviews.llvm.org/D18158





More information about the llvm-commits mailing list