[Mlir-commits] [mlir] [mlir] transform dialect; add pre/post-condition type (PR #191813)

Mehdi Amini llvmlistbot at llvm.org
Thu Apr 16 08:47:28 PDT 2026


================
@@ -104,6 +104,46 @@ transform::AnyParamType::checkPayload(Location loc,
   return DiagnosedSilenceableFailure::success();
 }
 
+//===----------------------------------------------------------------------===//
+// transform::NormalizedOpType
+//===----------------------------------------------------------------------===//
+
+DiagnosedSilenceableFailure
+transform::NormalizedOpType::checkPayload(Location loc,
+                                          ArrayRef<Operation *> payload) const {
+  // Return any definite failure or the first silenceable failure.
+  DiagnosedSilenceableFailure overallResult =
----------------
joker-eph wrote:

Also `dyn_cast<T>(value)` results as well, basically "when the type is obvious from the context". It's a readability thing...

It could be argued here that the type is present and this is calling a static constructor:

```
auto overallResult = DiagnosedSilenceableFailure::success();
```

(which would also make the statement fit on a single line).

We don't really have a strong policy, so it becomes a question of estimating readability between author/reviewers.

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


More information about the Mlir-commits mailing list