diff options
author | James Newling <james.newling@gmail.com> | 2025-06-02 11:15:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-02 11:15:25 -0700 |
commit | 543446a35309d82919dc1b021125e978a7451b12 (patch) | |
tree | 2b40ff6554fdc642522ace1ec99d3dd7c748819a /llvm/lib/CodeGen/MachineCopyPropagation.cpp | |
parent | 3dffd7117486785ad919ed394fdb1f345634c242 (diff) | |
download | llvm-543446a35309d82919dc1b021125e978a7451b12.zip llvm-543446a35309d82919dc1b021125e978a7451b12.tar.gz llvm-543446a35309d82919dc1b021125e978a7451b12.tar.bz2 |
[mli][vector] canonicalize vector.from_elements from ascending extracts (#139819)
Example:
```mlir
%0 = vector.extract %source[0, 0] : i8 from vector<1x2xi8>
%1 = vector.extract %source[0, 1] : i8 from vector<1x2xi8>
%2 = vector.from_elements %0, %1 : vector<2xi8>
```
becomes
```mlir
%2 = vector.shape_cast %source : vector<1x2xi8> to vector<2xi8>
```
It was decided that we should spill canonicalization tests into new
files (see
[discussion](https://github.com/llvm/llvm-project/pull/135096#pullrequestreview-2760245596))
In view of this I added the new tests to a new file specifically for
canonicalization of from_elements. To be consistent in the location of
the tests, I moved existing tests `extract_scalar_from_from_element`,
`extract_1d_from_from_elements`, `extract_2d_from_from_elements` and
`from_elements_to_splat` from `canonicalize.mlir` to
`canonicalze/vector-from-elements.mlir`. In addition to moving I changed
the LIT variables to all be upper-case for consistency.
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
0 files changed, 0 insertions, 0 deletions