[Mlir-commits] [mlir] [mlir][Vector] add vector.insert canonicalization pattern for vectors created from ub.poison (PR #142944)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Fri Aug 1 13:15:49 PDT 2025
https://github.com/banach-space commented:
Thanks for the updates. I am wondering whether this is robust enough to handle overlapping `vector.insert` operations?
Also, I am not sure whether this would be beneficial? Also, are there any tests for this case?
```
// Before:
%poison = ub.poison : vector<2x3xi64>
%v1 = vector.insert %cv0, %poison[0] : vector<3xi64> into vector<2x3xi64>
%result = vector.insert %cv1, %v1[1] : vector<3xi64> into vector<2x3xi64>
// After:
%v1 = vector.extract %cv0[0] : i64 from vector<3xi64>
%v2 = vector.extract %cv0[1] : i64 from vector<3xi64>
%v3 = vector.extract %cv0[2] : i64 from vector<3xi64>
%v4 = vector.extract %cv1[0] : i64 from vector<3xi64>
%v5 = vector.extract %cv1[1] : i64 from vector<3xi64>
%v6 = vector.extract %cv1[2] : i64 from vector<3xi64>
%result = vector.from_elements %v1, %v2, %v3, %v4, %v5, %v6 : vector<2x3xi64>
```
https://github.com/llvm/llvm-project/pull/142944
More information about the Mlir-commits
mailing list