OSDN Git Service

[LoopUnroll] Add a cl::opt to force peeling, for testing purposes.
authorDavide Italiano <davide@freebsd.org>
Mon, 28 Aug 2017 19:50:55 +0000 (19:50 +0000)
committerDavide Italiano <davide@freebsd.org>
Mon, 28 Aug 2017 19:50:55 +0000 (19:50 +0000)
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

lib/Transforms/Scalar/LoopUnrollPass.cpp

index fb50a35..1008f2c 100644 (file)
@@ -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 "
@@ -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)