This is an archive of the discontinued LLVM Phabricator instance.

[ODS] Use Adaptor Trait for Shaped Type Inference
ClosedPublic

Authored by amandatang on Jul 13 2023, 3:55 PM.

Details

Summary

Author inferReturnTypeComponents methods with the Op Adaptor by using the InferShapedTypeOpAdaptor.

Diff Detail

Event Timeline

amandatang created this revision.Jul 13 2023, 3:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 3:55 PM
amandatang requested review of this revision.Jul 13 2023, 3:55 PM
amandatang retitled this revision from Use Adaptor Wrapper Trait for Shaped Type Inference to [ODS] Use Adaptor Trait for Shaped Type Inference.Jul 13 2023, 3:57 PM
amandatang edited the summary of this revision. (Show Details)
amandatang added reviewers: jpienaar, okwank.

clang format

jpienaar added inline comments.Jul 14 2023, 7:58 AM
mlir/include/mlir/Interfaces/InferTypeOpInterface.td
229

Why not just rely on overloading?

Use function overloading

amandatang marked an inline comment as done.Jul 14 2023, 10:19 AM
jpienaar accepted this revision.Jul 18 2023, 2:21 PM
This revision is now accepted and ready to land.Jul 18 2023, 2:21 PM
jpienaar added inline comments.Jul 18 2023, 10:29 PM
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
410

You are querying inputShape's rank without checking if it was null here. cast is preferred in that case.

mlir/test/lib/Dialect/Test/TestDialect.cpp
1456

MLIR style is to elide trivial braces.

amandatang marked 2 inline comments as done.

Address comments

Clang format

This revision was automatically updated to reflect the committed changes.