This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix arith ops verifier for tensor with encoding
ClosedPublic

Authored by ThomasRaoux on Jul 28 2023, 9:40 AM.

Details

Summary

The verifier for some arith ops were not considering that ranked
tensor types can have encodings.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Jul 28 2023, 9:40 AM
Herald added a project: Restricted Project. · View Herald Transcript
ThomasRaoux requested review of this revision.Jul 28 2023, 9:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2023, 9:40 AM
jpienaar added inline comments.
mlir/lib/Dialect/Arith/IR/ArithOps.cpp
132

This could just be a call to cloneWith with no shape and just element type too.

Address comment

ThomasRaoux marked an inline comment as done.Jul 28 2023, 10:56 AM
ThomasRaoux added inline comments.
mlir/lib/Dialect/Arith/IR/ArithOps.cpp
132

ah yes much simpler indeed. Changed it.

kuhar accepted this revision.Jul 28 2023, 11:52 AM

LGTM

mlir/test/Dialect/Arith/invalid.mlir
213

nit: Do we need to use the generic syntax here?

This revision is now accepted and ready to land.Jul 28 2023, 11:52 AM
ThomasRaoux marked an inline comment as done.Jul 28 2023, 12:55 PM
ThomasRaoux added inline comments.
mlir/test/Dialect/Arith/invalid.mlir
213

I believe that's the only way to explicitly specify both the input and output types? Do you see a different way to do this?

kuhar added inline comments.Jul 28 2023, 12:58 PM
mlir/test/Dialect/Arith/invalid.mlir
213

Ah, I missed the error line just above, nvm

This revision was automatically updated to reflect the committed changes.