[all-commits] [llvm/llvm-project] 62a5e5: [mlir] Improve dialect conversion failure diagnost...

Jeongseok Son via All-commits all-commits at lists.llvm.org
Thu Mar 5 21:31:24 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62a5e5391971a5e8b874660135a0f77511d1dbb5
      https://github.com/llvm/llvm-project/commit/62a5e5391971a5e8b874660135a0f77511d1dbb5
  Author: Jeongseok Son <jeongseok.son at gmail.com>
  Date:   2026-03-06 (Fri, 06 Mar 2026)

  Changed paths:
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/test/Transforms/test-legalizer.mlir

  Log Message:
  -----------
  [mlir] Improve dialect conversion failure diagnostics (#182729)

This PR improves MLIR dialect conversion failure diagnostics when
legalization fails.

Previously, the diagnostic mostly included the operation name (and in
partial conversion, whether it was explicitly marked illegal). This
change keeps that prefix and appends the printed failing operation. This
provides immediate operand/result/type context directly in the same
error line.

### Example

Before:
```
failed to legalize operation 'test.type_consumer' that was explicitly marked illegal
```

After:
```
failed to legalize operation 'test.type_consumer' that was explicitly marked illegal: "test.type_consumer"(%arg0) : (f32) -> ()
```

### Tests
- Updated `mlir/test/Transforms/test-legalizer.mlir` expectations for
the richer emitted diagnostic.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list