Skip to content

Commit b4ca7e0

Browse files
committed
Renamed to test pass
1 parent 26da930 commit b4ca7e0

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

mlir/include/mlir/Dialect/SCF/Transforms/Passes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def SCFForToWhileLoop : Pass<"scf-for-to-while"> {
154154
}];
155155
}
156156

157-
def SCFUpliftWhileToFor : Pass<"scf-uplift-while-to-for"> {
157+
def TestSCFUpliftWhileToFor : Pass<"test-scf-uplift-while-to-for"> {
158158
let summary = "Uplift scf.while ops to scf.for";
159159
let description = [{
160160
This pass tries to uplift `scf.while` ops to `scf.for` if they have a

mlir/include/mlir/Dialect/SCF/Transforms/Patterns.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ void populateSCFLoopPipeliningPatterns(RewritePatternSet &patterns,
8080
void populateSCFForLoopCanonicalizationPatterns(RewritePatternSet &patterns);
8181

8282
/// Populate patterns to uplift `scf.while` ops to `scf.for`.
83+
/// Uplifitng expects a specific ops pattern:
84+
/// * `before` block consisting of single arith.cmp op
85+
/// * `after` block containing arith.addi
8386
void populateUpliftWhileToForPatterns(RewritePatternSet &patterns);
8487

8588
} // namespace scf

mlir/lib/Dialect/SCF/Transforms/UpliftWhileToFor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
2121

2222
namespace mlir {
23-
#define GEN_PASS_DEF_SCFUPLIFTWHILETOFOR
23+
#define GEN_PASS_DEF_TESTSCFUPLIFTWHILETOFOR
2424
#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
2525
} // namespace mlir
2626

@@ -218,9 +218,9 @@ struct UpliftWhileOp : public OpRewritePattern<scf::WhileOp> {
218218
}
219219
};
220220

221-
struct SCFUpliftWhileToFor final
222-
: impl::SCFUpliftWhileToForBase<SCFUpliftWhileToFor> {
223-
using SCFUpliftWhileToForBase::SCFUpliftWhileToForBase;
221+
struct TestSCFUpliftWhileToFor final
222+
: impl::TestSCFUpliftWhileToForBase<TestSCFUpliftWhileToFor> {
223+
using TestSCFUpliftWhileToForBase::TestSCFUpliftWhileToForBase;
224224

225225
void runOnOperation() override {
226226
Operation *op = getOperation();

mlir/test/Dialect/SCF/uplift-while.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(scf-uplift-while-to-for))' -split-input-file -allow-unregistered-dialect | FileCheck %s
1+
// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(test-scf-uplift-while-to-for))' -split-input-file -allow-unregistered-dialect | FileCheck %s
22

33
func.func @uplift_while(%arg0: index, %arg1: index, %arg2: index) -> index {
44
%0 = scf.while (%arg3 = %arg0) : (index) -> (index) {

0 commit comments

Comments
 (0)