Skip to content

Commit

Permalink
[LoopUnroll] Enable PGO-based loop peeling by default.
Browse files Browse the repository at this point in the history
This enables peeling of loops with low dynamic iteration count by default,
when profile information is available.

Differential Revision: https://reviews.llvm.org/D27734


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295796 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mkuperst committed Feb 22, 2017
1 parent 7d93793 commit 2b21feb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Transforms/Scalar/LoopUnrollPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static cl::opt<unsigned> FlatLoopTripCountThreshold(
"aggressively unrolled."));

static cl::opt<bool>
UnrollAllowPeeling("unroll-allow-peeling", cl::Hidden,
UnrollAllowPeeling("unroll-allow-peeling", cl::init(true), cl::Hidden,
cl::desc("Allows loops to be peeled when the dynamic "
"trip count is known to be low."));

Expand Down Expand Up @@ -155,7 +155,7 @@ static TargetTransformInfo::UnrollingPreferences gatherUnrollingPreferences(
UP.AllowExpensiveTripCount = false;
UP.Force = false;
UP.UpperBound = false;
UP.AllowPeeling = false;
UP.AllowPeeling = true;

// Override with any target specific settings
TTI.getUnrollingPreferences(L, UP);
Expand Down
2 changes: 1 addition & 1 deletion test/Transforms/LoopUnroll/peel-loop-pgo.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: opt < %s -S -debug-only=loop-unroll -loop-unroll -unroll-allow-peeling 2>&1 | FileCheck %s
; RUN: opt < %s -S -debug-only=loop-unroll -loop-unroll 2>&1 | FileCheck %s
; REQUIRES: asserts

; Make sure we use the profile information correctly to peel-off 3 iterations
Expand Down

0 comments on commit 2b21feb

Please sign in to comment.