This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Clean-up ViewLikeOpInterface w.r.t. kDynamic change.
ClosedPublic

Authored by pifon2a on Nov 21 2022, 11:53 PM.

Details

Summary

Now we have only one constant to indicate dynamic something, we can simplify ViewLikeInterface.

Diff Detail

Event Timeline

pifon2a created this revision.Nov 21 2022, 11:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 11:53 PM
pifon2a requested review of this revision.Nov 21 2022, 11:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 11:53 PM
pifon2a updated this revision to Diff 477079.Nov 21 2022, 11:56 PM

Update BuiltinTypeInterfaces.cpp

Thanks for the cleanup!

mlir/lib/Interfaces/ViewLikeInterface.cpp
108

Not necessarily for this PR but we should aim for making ShapedType::kDynamic and so we would need a ShapedType::setDynamic(int64_t &) at some point.

This revision is now accepted and ready to land.Nov 22 2022, 12:14 AM
pifon2a added inline comments.Nov 22 2022, 12:45 AM
mlir/lib/Interfaces/ViewLikeInterface.cpp
108

Should it be setDynamic(int64_t &) or int64_t getDynamic()?

mlir/lib/Interfaces/ViewLikeInterface.cpp
108

I'd think there is not much different between int64_t getDynamic() and ShapedType::kDynamic : it is just a different spelling but the magic constant gets leaked in the same way.

setDynamic avoids leaking altogether.

This revision was landed with ongoing or failed builds.Nov 22 2022, 1:52 AM
This revision was automatically updated to reflect the committed changes.