Skip to content

Commit b6d8345

Browse files
committed
Address comments
1 parent 99d69df commit b6d8345

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

llvm/lib/Transforms/Scalar/LoopInterchange.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ using CharMatrix = std::vector<std::vector<char>>;
7575
} // end anonymous namespace
7676

7777
// Minimum loop depth supported.
78-
static const unsigned MinLoopNestDepth = 2;
78+
static cl::opt<unsigned int> MinLoopNestDepth(
79+
"loop-interchange-min-loop-nest-depth", cl::init(2), cl::Hidden,
80+
cl::desc("Minimum depth of loop nest considered for the transform"));
7981

8082
// Maximum loop depth supported.
81-
static const unsigned MaxLoopNestDepth = 10;
83+
static cl::opt<unsigned int> MaxLoopNestDepth(
84+
"loop-interchange-max-loop-nest-depth", cl::init(10), cl::Hidden,
85+
cl::desc("Maximum depth of loop nest considered for the transform"));
8286

8387
#ifndef NDEBUG
8488
static void printDepMatrix(CharMatrix &DepMatrix) {

llvm/test/Transforms/LoopInterchange/deep-loop-nest.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
; REQUIRES: asserts
2-
; RUN: opt < %s -passes=loop-interchange -debug -disable-output 2>&1| FileCheck %s
1+
; RUN: opt < %s -passes=loop-interchange -pass-remarks-missed='loop-interchange' \
2+
; RUN: -disable-output 2>&1 | FileCheck %s
33

4-
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4+
; RUN: opt < %s -passes=loop-interchange -pass-remarks-missed='loop-interchange' \
5+
; RUN: -loop-interchange-max-loop-nest-depth=12 -disable-output 2>&1 | \
6+
; RUN: FileCheck --allow-empty -check-prefix=CHECK-MAX %s
57

6-
; For deep loop nest, delinearization should not be run.
8+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
79

8-
; CHECK-NOT: Delinearizing
9-
; CHECK-NOT: Strides:
10-
; CHECK-NOT: Terms:
11-
; CHECK: Unsupported depth of loop nest 11, the supported range is [2, 10].
10+
; CHECK: Unsupported depth of loop nest, the supported range is [2, 10].
11+
; CHECK-MAX-NOT: Unsupported depth of loop nest, the supported range is [2, 10].
1212
define void @big_loop_nest() {
1313
entry:
1414
br label %for1.header

0 commit comments

Comments
 (0)