diff options
| author | Hsiang-Chieh Tsou <65450151+hsjts0u@users.noreply.github.com> | 2025-11-07 00:32:39 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-07 09:32:39 +0100 |
| commit | a257a063c6fdcbc1db897d360c3791d8c4f4e48d (patch) | |
| tree | fc90332e80c0520b186a0b656640d3a42933e312 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
| parent | 1a34007f5f86088d59b0c5ce86ead58fb12177e0 (diff) | |
| download | llvm-a257a063c6fdcbc1db897d360c3791d8c4f4e48d.zip llvm-a257a063c6fdcbc1db897d360c3791d8c4f4e48d.tar.gz llvm-a257a063c6fdcbc1db897d360c3791d8c4f4e48d.tar.bz2 | |
[mlir][linalg-transform] dyn_cast DestinationStyleOpInterface and early return (#166299)
Use `dyn_cast` instead of `cast` and early return if op does not
implement the `DestinationStyleOpInterface`. Before the change the
following IR would cause a segfault when the transform interpreter is
run, where `myop.a` and `myop.b` implement the `TilingInterface` and not
the `DestinationStyleOpInterface`. Tried looking for ops in the upstream
dialect that implement the `TilingInterface` and not the
`DestinationStyleOpInterface` to add a test but could not find any.
```mlir
module {
func.func @fuse(%arg0: tensor<4x4x4xf32>, %arg1: tensor<4x4x4xf32>) -> tensor<4x4x4xf32> {
%mul = "myop.a"(%arg0, %arg1) : (tensor<4x4x4xf32>, tensor<4x4x4xf32>) -> tensor<4x4x4xf32>
%add = "myop.b"(%mul, %mul) : (tensor<4x4x4xf32>, tensor<4x4x4xf32>) -> tensor<4x4x4xf32>
return %add : tensor<4x4x4xf32>
}
transform.sequence failures(propagate) {
^bb0(%func: !transform.any_op):
%mul = transform.structured.match ops{["myop.a"]} in %func : (!transform.any_op) -> !transform.any_op
%add = transform.structured.match ops{["myop.b"]} in %func : (!transform.any_op) -> !transform.any_op
%loop, %tiled = transform.structured.tile_using_forall %add tile_sizes [1, 2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%mul_fused, %mul_containing = transform.structured.fuse_into_containing_op %mul into %tiled : (!transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
```
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions
