[Mlir-commits] [mlir] [mlir][transform] Guard parametric loop tiling pass from no option (PR #118254)

Mehdi Amini llvmlistbot at llvm.org
Tue Dec 3 18:02:05 PST 2024


================
@@ -40,6 +40,11 @@ class SimpleParametricLoopTilingPass
   }
 
   void runOnOperation() override {
+    if (sizes.empty()) {
+      getOperation()->emitError("expect non-empty outer loop sizes");
----------------
joker-eph wrote:

I wouldn't use `getOperation()` because we don't need to attach any IR-related context.

I would also make the error message more clear on the fact that the error is about pass-options.

```suggestion
      emitError(UnknownLoc::get(getContext()), "missing `" + getArgument() + "` pass-option for outer loop sizes");
```

https://github.com/llvm/llvm-project/pull/118254


More information about the Mlir-commits mailing list