Skip to content

Commit

Permalink
[LoopUnroll] Add a cl::opt to force peeling, for testing purposes.
Browse files Browse the repository at this point in the history
Will be used to test the patch proposed in D37153.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311915 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dcci committed Aug 28, 2017
1 parent 863f349 commit 628b9ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Transforms/Scalar/LoopUnrollPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ static cl::opt<unsigned> UnrollFullMaxCount(
cl::desc(
"Set the max unroll count for full unrolling, for testing purposes"));

static cl::opt<unsigned> UnrollPeelCount(
"unroll-peel-count", cl::Hidden,
cl::desc("Set the unroll peeling count, for testing purposes"));

static cl::opt<bool>
UnrollAllowPartial("unroll-allow-partial", cl::Hidden,
cl::desc("Allows loops to be partially unrolled until "
Expand Down Expand Up @@ -183,6 +187,8 @@ static TargetTransformInfo::UnrollingPreferences gatherUnrollingPreferences(
UP.MaxCount = UnrollMaxCount;
if (UnrollFullMaxCount.getNumOccurrences() > 0)
UP.FullUnrollMaxCount = UnrollFullMaxCount;
if (UnrollPeelCount.getNumOccurrences() > 0)
UP.PeelCount = UnrollPeelCount;
if (UnrollAllowPartial.getNumOccurrences() > 0)
UP.Partial = UnrollAllowPartial;
if (UnrollAllowRemainder.getNumOccurrences() > 0)
Expand Down

0 comments on commit 628b9ff

Please sign in to comment.