diff options
author | Matthias Springer <me@m-sp.org> | 2023-12-19 14:17:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 14:17:10 +0900 |
commit | 3a087c15922398d963439dbfc719dd0f2f2f15da (patch) | |
tree | a1b5e96557d64ab9f0bb292e436ed850c9076a25 /llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | |
parent | 6a7bbf712df5637a93dbc4f918e7a69e23aa917c (diff) | |
download | llvm-3a087c15922398d963439dbfc719dd0f2f2f15da.zip llvm-3a087c15922398d963439dbfc719dd0f2f2f15da.tar.gz llvm-3a087c15922398d963439dbfc719dd0f2f2f15da.tar.bz2 |
[mlir][linalg] Fix invalid IR in Linalg op fusion (#74425)
Linalg op fusion (`Linalg/Transforms/Fusion.cpp`) used to generate
invalid fused producer ops:
```
error: 'linalg.conv_2d_nhwc_hwcf' op expected type of operand #2 ('tensor<1x8x16x4xf32>') to match type of corresponding result ('tensor<?x?x?x?xf32>')
note: see current operation:
%24 = "linalg.conv_2d_nhwc_hwcf"(%21, %22, %23) <{dilations = dense<1> : tensor<2xi64>, operandSegmentSizes = array<i32: 2, 1>, strides = dense<2> : tensor<2xi64>}> ({
^bb0(%arg9: f32, %arg10: f32, %arg11: f32):
%28 = "arith.mulf"(%arg9, %arg10) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
%29 = "arith.addf"(%arg11, %28) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
"linalg.yield"(%29) : (f32) -> ()
}) {linalg.memoized_indexing_maps = [affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1 * 2 + d4, d2 * 2 + d5, d6)>, affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d4, d5, d6, d3)>, affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1, d2, d3)>]} : (tensor<1x?x?x3xf32>, tensor<3x3x3x4xf32>, tensor<1x8x16x4xf32>) -> tensor<?x?x?x?xf32>
```
This is a problem because the input IR to greedy pattern rewriter during
`-test-linalg-greedy-fusion` is invalid. This commit fixes tests such as
`mlir/test/Dialect/Linalg/tile-and-fuse-tensors.mlir` when verifying the
IR after each pattern application (#74270).
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp')
0 files changed, 0 insertions, 0 deletions