This is an archive of the discontinued LLVM Phabricator instance.

[mlir][MemRef] Add early exit for computing dropped unit-dims.
ClosedPublic

Authored by mravishankar on Mar 15 2022, 8:03 PM.

Details

Summary

Computing dropped unit-dims when all the unit dims are dropped, does
not need to check for strides being dropped.
This also enables canonicalization of reduced-rank subviews.

Diff Detail

Event Timeline

mravishankar created this revision.Mar 15 2022, 8:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2022, 8:03 PM
mravishankar requested review of this revision.Mar 15 2022, 8:03 PM
gysit accepted this revision.Mar 16 2022, 12:20 AM
This revision is now accepted and ready to land.Mar 16 2022, 12:20 AM

I believe this change produces a comparison warning with clang:

llvm-project/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp:764:50: error: comparison of integers of different signs: 'unsigned long' and 'int64_t' (aka 'long') [-Werror,-Wsign-compare]
  if (unusedDims.count() + reducedType.getRank() == originalType.getRank())