diff options
author | Han-Chung Wang <hanhan0912@gmail.com> | 2024-06-03 16:39:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-03 16:39:52 -0700 |
commit | 0ea1271ee13c8c3d765904dba16dd27b91584d66 (patch) | |
tree | 316ba86757929781be150423520cc1acd30312cc /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | 43847c1de60ddba26d93c138ad81aa0d3b3c8c31 (diff) | |
download | llvm-0ea1271ee13c8c3d765904dba16dd27b91584d66.zip llvm-0ea1271ee13c8c3d765904dba16dd27b91584d66.tar.gz llvm-0ea1271ee13c8c3d765904dba16dd27b91584d66.tar.bz2 |
[mlir][vector] Add support for unrolling vector.bitcast ops. (#94064)
The revision unrolls vector.bitcast like:
```mlir
%0 = vector.bitcast %arg0 : vector<2x4xi32> to vector<2x2xi64>
```
to
```mlir
%cst = arith.constant dense<0> : vector<2x2xi64>
%0 = vector.extract %arg0[0] : vector<4xi32> from vector<2x4xi32>
%1 = vector.bitcast %0 : vector<4xi32> to vector<2xi64>
%2 = vector.insert %1, %cst [0] : vector<2xi64> into vector<2x2xi64>
%3 = vector.extract %arg0[1] : vector<4xi32> from vector<2x4xi32>
%4 = vector.bitcast %3 : vector<4xi32> to vector<2xi64>
%5 = vector.insert %4, %2 [1] : vector<2xi64> into vector<2x2xi64>
```
The scalable vector is not supported because of the limitation of
`vector::createUnrollIterator`. The targetRank could mismatch the final
rank during unrolling; there is no direct way to query what the final
rank is from the object.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
0 files changed, 0 insertions, 0 deletions