This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Vector] Add 0-d vector support to 'vector.shape_cast`
ClosedPublic

Authored by dcaballe on May 22 2023, 4:01 PM.

Details

Summary

This patch adds support to shape cast a vector<1x1x1...1xElemenType> to
a vector<ElementType> and the other way around.

Diff Detail

Event Timeline

dcaballe created this revision.May 22 2023, 4:01 PM
Herald added a project: Restricted Project. · View Herald Transcript
dcaballe requested review of this revision.May 22 2023, 4:01 PM
awarzynski accepted this revision.May 23 2023, 8:37 AM

Nice, thank you! LGTM

mlir/lib/Dialect/Vector/IR/VectorOps.cpp
4620

[nit] The comment above applies to

if (rankA == 0 && llvm::all_of(b, isOne))
  return true;

rather than the lambda (i.e. isOne). Could you move it before merging? Ta!

This revision is now accepted and ready to land.May 23 2023, 8:37 AM
dcaballe marked an inline comment as done.May 23 2023, 10:14 AM

Thanks!

hanchung accepted this revision.May 23 2023, 10:21 AM