diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp --- a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp @@ -218,9 +218,8 @@ FlatAffineConstraints cst; getIndexSet(input, &cst); if (!cst.isHyperRectangular(0, width)) { - llvm::dbgs() << "tiled code generation unimplemented for the " - "non-hyperrectangular case, op:" - << *rootAffineForOp << "\n"; + rootAffineForOp.emitError("tiled code generation unimplemented for the " + "non-hyperrectangular case"); return failure(); } diff --git a/mlir/test/Dialect/Affine/loop-tiling-unsupported.mlir b/mlir/test/Dialect/Affine/loop-tiling-unsupported.mlir new file mode 100644 --- /dev/null +++ b/mlir/test/Dialect/Affine/loop-tiling-unsupported.mlir @@ -0,0 +1,15 @@ +// RUN: mlir-opt %s -affine-loop-tile="tile-size=32" -split-input-file -verify-diagnostics + +// ----- + +#ub = affine_map<(d0)[s0] -> (d0, s0)> +func @non_hyperrect_loop() { + %N = constant 128 : index + // expected-error@+1 {{tiled code generation unimplemented for the non-hyperrectangular case}} + affine.for %i = 0 to %N { + affine.for %j = 0 to min #ub(%i)[%N] { + affine.yield + } + } + return +}