[all-commits] [llvm/llvm-project] 02fb97: [mlir] Improve GreedyPatternRewriteDriver logging ...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Sat Feb 15 12:06:53 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02fb9769417f972ffedefe32d7c0ae9cabd29917
      https://github.com/llvm/llvm-project/commit/02fb9769417f972ffedefe32d7c0ae9cabd29917
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2025-02-15 (Sat, 15 Feb 2025)

  Changed paths:
    M mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp

  Log Message:
  -----------
  [mlir] Improve GreedyPatternRewriteDriver logging (#127314)

Currently, when `GreedyPatternRewriteDriver` fails, the log output
contains nested failure messages:

```bash
   } -> failure : pattern failed to match
} -> failure : pattern failed to match
```

This may seem redundant, but these messages refer to different aspects
of the pattern application logic. This patch clarifies the distinction
by separately logging:

* Success/failure for a specific pattern (e.g., "_this pattern_ failed
  to match on the Op currently being processed").
* Success/failure for an operation as a whole (e.g., "_all patterns_
  failed to match the Op currently being processed").

Before (example with success):
```bash
Processing operation : (...) {

  * Pattern (...) -> ()' {
Trying to match "..."
    ** Match Failure : (...)
  } -> failure : pattern failed to match

  * Pattern (...) -> ()' {
Trying to match "..."
  } -> success : pattern applied successfully
} -> success : pattern matched
```

After (example with success):
```bash
Processing operation : (...) {

  * Pattern (...) -> ()' {
Trying to match "..."
    ** Match Failure : (...)
  } -> failure : pattern failed to match

  * Pattern (...) -> ()' {
Trying to match "..."
  } -> success : pattern applied successfully
} -> success : at least one pattern matched
```

This improves log clarity, making it easier to distinguish pattern-level
failures from operation-level outcomes.



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