This is primarily to avoid trailing unit dims:
%1 = vector.create_mask %c1, %dim_0, %c1, %c1 : vector<1x4x1x1xi1> %2 = vector.shape_cast %1 : vector<1x4x1x1xi1> to vector<1x4xi1>
becomes:
%1 = vector.create_mask %c1, %dim_0 : vector<1x4xi1>
Paths
| Differential D158111
[mlir][vector] Add canonicalzation pattern for shape_cast(create_mask) ClosedPublic Authored by awarzynski on Aug 16 2023, 1:13 PM.
Details Summary This is primarily to avoid trailing unit dims: %1 = vector.create_mask %c1, %dim_0, %c1, %c1 : vector<1x4x1x1xi1> %2 = vector.shape_cast %1 : vector<1x4x1x1xi1> to vector<1x4xi1> becomes: %1 = vector.create_mask %c1, %dim_0 : vector<1x4xi1>
Diff Detail
Event Timeline
Comment Actions LGTM! Just a minor nit/question:
This revision is now accepted and ready to land.Aug 21 2023, 9:13 AM
Comment Actions Thanks for all the review, an update is coming shortly :)
Comment Actions
Closed by commit rG1d9dcca9e3cd: [mlir][vector] Add canonicalzation pattern for shape_cast(create_mask) (authored by awarzynski). · Explain WhyAug 24 2023, 12:15 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 552432 mlir/lib/Dialect/Vector/IR/VectorOps.cpp
mlir/test/Dialect/Vector/canonicalize.mlir
|
nit: shapeOpResTy