[all-commits] [llvm/llvm-project] fe56f5: [mlir][Pass] Fix crash when applying a pass to an ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sun Nov 23 17:57:26 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fe56f5c3d315bf3282a54a3b323cc462ce755136
      https://github.com/llvm/llvm-project/commit/fe56f5c3d315bf3282a54a3b323cc462ce755136
  Author: Matthias Springer <me at m-sp.org>
  Date:   2025-11-24 (Mon, 24 Nov 2025)

  Changed paths:
    M mlir/include/mlir/Pass/Pass.h
    M mlir/lib/Pass/Pass.cpp
    M mlir/test/Dialect/Transform/test-pass-application.mlir
    A mlir/test/Pass/invalid-unsupported-operation.mlir
    M mlir/test/Pass/pipeline-invalid.mlir

  Log Message:
  -----------
  [mlir][Pass] Fix crash when applying a pass to an optional interface (#169262)

Interfaces can be optional: whether an op implements an interface or not
can depend on the state of the operation.

```
// An optional code block for adding additional "classof" logic. This can
// be used to better enable "optional" interfaces, where an entity only
// implements the interface if some dynamic characteristic holds.
// `$_attr`/`$_op`/`$_type` may be used to refer to an instance of the
// interface instance being checked.
code extraClassOf = "";
```

The current `Pass::canScheduleOn(RegisteredOperationName)` is
insufficient. This commit adds an additional overload to inspect
`Operation *`.

This commit fixes a crash when scheduling an `InterfacePass` for an
optional interface on an operation that does not actually implement the
interface.

This is a re-upload of #168499, which was reverted.



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