This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add trait SameOperandsAndResultRank
ClosedPublic

Authored by Tai78641 on Jul 26 2023, 2:08 PM.

Details

Summary

This adds a native op trait SameOperandsAndResultRank
and associated verifier that checks that an operator's
operands and result types have same ranks if their ranks
are known.

Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I2d536f77be10f3710d0c8d84c907ff492a984fda

Diff Detail

Event Timeline

Tai78641 created this revision.Jul 26 2023, 2:08 PM
Herald added a project: Restricted Project. · View Herald Transcript
Tai78641 requested review of this revision.Jul 26 2023, 2:08 PM
rsuderman requested changes to this revision.Jul 31 2023, 10:35 AM
rsuderman added a subscriber: rsuderman.
rsuderman added inline comments.
mlir/include/mlir/IR/OpDefinition.h
344

Try to match the naming convention above. Should be verifySameOperandsAndResultRank

This revision now requires changes to proceed.Jul 31 2023, 10:35 AM
Tai78641 updated this revision to Diff 545746.Jul 31 2023, 11:17 AM

renamed verify function to verifySameOperandsAndResultRank

rsuderman added inline comments.Jul 31 2023, 11:23 AM
mlir/include/mlir/IR/OpDefinition.h
1124

You should also have the class name match. I.e. SameOperandsAndResultRank as above

mlir/include/mlir/Interfaces/InferTypeOpInterface.td
373

Ditto.

mlir/test/lib/Dialect/Test/TestOps.td
697

Verify that the name convention maps here.

Tai78641 updated this revision to Diff 545793.Jul 31 2023, 1:49 PM

renamed trait to SameOperandsAndResultRank

Tai78641 retitled this revision from [mlir] Add trait AllRanksMatchIfKnown to [mlir] Add trait SameOperandsAndResultRank.Jul 31 2023, 2:26 PM
Tai78641 edited the summary of this revision. (Show Details)
Tai78641 marked 4 inline comments as done.Aug 4 2023, 8:12 AM
rsuderman accepted this revision.Aug 17 2023, 2:44 PM
This revision is now accepted and ready to land.Aug 17 2023, 2:44 PM
This revision was automatically updated to reflect the committed changes.
jmorse added a subscriber: jmorse.Sep 7 2023, 10:43 AM

Apologies, copy-pasted your Phab URL into my commit there without updating, sorry for the noise -- a case of mistaken identity ._.