Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions mlir/test/Transforms/invalid-outer-loop-size.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: mlir-opt -test-extract-fixed-outer-loops %s -verify-diagnostics

// CHECK-LABEL: @no_crash
func.func @no_crash(%arg0: memref<?x?xf32>) {
// expected-error@-5 {{expect non-empty outer loop sizes}}
%c2 = arith.constant 2 : index
%c44 = arith.constant 44 : index
%c1 = arith.constant 1 : index
scf.for %i = %c2 to %c44 step %c1 {
scf.for %j = %c1 to %c44 step %c2 {
memref.load %arg0[%i, %j]: memref<?x?xf32>
}
}
return
}
5 changes: 5 additions & 0 deletions mlir/test/lib/Dialect/SCF/TestLoopParametricTiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class SimpleParametricLoopTilingPass
}

void runOnOperation() override {
if (sizes.empty()) {
getOperation()->emitError("expect non-empty outer loop sizes");
signalPassFailure();
return;
}
getOperation()->walk([this](scf::ForOp op) {
// Ignore nested loops.
if (op->getParentRegion()->getParentOfType<scf::ForOp>())
Expand Down
Loading