diff options
author | Aaron St George <aaronstgeorge@gmail.com> | 2025-05-16 15:06:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-16 15:06:42 -0700 |
commit | da944e009955982927759c2f1fd47d43b236cc51 (patch) | |
tree | 6991cd0fc4c1d71d80ad0e671dff91696df0f9fa /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | ba38e56c989af932eaa7b287a8e6197abf693e57 (diff) | |
download | llvm-da944e009955982927759c2f1fd47d43b236cc51.zip llvm-da944e009955982927759c2f1fd47d43b236cc51.tar.gz llvm-da944e009955982927759c2f1fd47d43b236cc51.tar.bz2 |
[mlir][tensor] Add shape inference support for `tensor.concat` op. (#140168)
## description
`tensor.concat` requires operands and the result to match on all
dimensions except the concatenation dimension. If one operand is already
static in those dimensions, the other operands and result type may
safely be refined to that same static shape. This PR adds
canonicalization patterns to refine `tensor.concat` types and propagate
static shapes to other canonicalization patterns through casts.
## example
```mlir
%2 = tensor.concat dim(0) %0, %1: (tensor<?x12xi32>, tensor<?x?xi32>) ->tensor<?x12xi32>
```
becomes:
```mlir
%cast = tensor.cast %1 : tensor<?x?xi32> to tensor<?x12xi32>
%2 = tensor.concat dim(0) %0, %cast : (tensor<?x12xi32>,
tensor<?x12xi32>) -> tensor<?x12xi32>
```
---------
Co-authored-by: Ian Wood <ianwood2024@u.northwestern.edu>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions