This is an archive of the discontinued LLVM Phabricator instance.

[mlir] [VectorOps] Handle 'vector.shape_cast' lowering for all cases
ClosedPublic

Authored by aartbik on Jun 9 2020, 2:15 PM.

Details

Summary

Even though this operation is intended for 1d/2d conversions currently,
leaving a semantic hole in the lowering prohibits proper testing of this
operation. This CL adds a straightforward reference implementation for the
missing cases.

Diff Detail

Event Timeline

aartbik created this revision.Jun 9 2020, 2:15 PM
reidtatge accepted this revision.Jun 9 2020, 3:05 PM

Regarding the loop starting on line 1502: it bugs me that there's no readable/efficient way to assert "don't do this on the first (or last) iteration".

This revision is now accepted and ready to land.Jun 9 2020, 3:05 PM

Regarding the loop starting on line 1502: it bugs me that there's no readable/efficient way to assert "don't do this on the first (or last) iteration".

Yeah, I could unroll the loop once, but then other things become ugly. Or allow the index to "overshoot" but then we lose the nice assert.

rriddle added inline comments.Jun 9 2020, 4:28 PM
mlir/lib/Dialect/Vector/VectorTransforms.cpp
1469

///

This revision was automatically updated to reflect the committed changes.
aartbik marked an inline comment as done.Jun 9 2020, 4:57 PM
aartbik added inline comments.
mlir/lib/Dialect/Vector/VectorTransforms.cpp
1469

I was convinced I had triple checked this (pun intended), but I still missed it somehow :-)
Fix in new CL coming up....