This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] ShapedType accessor minor fixes + add isDynamicDim accessor
ClosedPublic

Authored by bondhugula on Apr 8 2020, 12:05 AM.

Details

Summary

Minor fixes for ShapedType accessors, use ShapedType::kDynamicSize, add ShapedType::isDynamicDim.

Diff Detail

Event Timeline

bondhugula created this revision.Apr 8 2020, 12:05 AM
ftynse accepted this revision.Apr 8 2020, 1:42 AM
ftynse added a subscriber: ftynse.
ftynse added inline comments.
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
1071

Can we initialize it to kDynamicSize instead of hardcoded -1?

bondhugula marked an inline comment as done.Apr 8 2020, 2:19 AM
bondhugula updated this revision to Diff 255930.Apr 8 2020, 2:20 AM

Address review comment.

rriddle accepted this revision.Apr 8 2020, 10:50 AM
This revision is now accepted and ready to land.Apr 8 2020, 10:50 AM

Can we initialize it to kDynamicSize instead of hardcoded -1?

Orthogonally to this revision, note that this is a particular pain point: there are a lot of -1 scattered around the codebase both in MLIR and things that depend on MLIR.
-1 is not good enough for representing dynamic offset and strides.
I had started an effort to clean that up a few months ago but did not see the light at the end of the tunnel..

nicolasvasilache accepted this revision.Apr 8 2020, 12:20 PM
bondhugula edited the summary of this revision. (Show Details)Apr 8 2020, 8:02 PM
This revision was automatically updated to reflect the committed changes.