This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NFC] Move SubTensorOp and SubTensorInsertOp to TensorDialect
ClosedPublic

Authored by springerm on Jun 17 2021, 6:38 PM.

Details

Summary

The main goal of this commit is to remove the dependency of Standard dialect on the Tensor dialect.

  • Rename ops: SubTensorOp --> ExtractSliceOp, SubTensorInsertOp --> InsertSliceOp
  • Some helper functions are (already) duplicated between the Tensor dialect and the MemRef dialect. To keep this commit smaller, this will be cleaned up in a separate commit.
  • Additional dialect dependencies: Shape --> Tensor, Tensor --> Standard
  • Remove dialect dependencies: Standard --> Tensor
  • Move canonicalization test cases to correct dialect (Tensor/MemRef).

Depends On D104506

Diff Detail

Event Timeline

springerm created this revision.Jun 17 2021, 6:38 PM
springerm requested review of this revision.Jun 17 2021, 6:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2021, 6:38 PM
springerm updated this revision to Diff 352906.Jun 17 2021, 8:33 PM

Reduce size of commit: Put "remove Standard --> MemRef dependency" into a separate commit.

silvas added a comment.EditedJun 18 2021, 7:52 AM

Thanks you Matthias for doing this! I apologize for leaving this in the sorry state that it was left in.

Please do update https://llvm.discourse.group/t/rfc-split-the-tensor-dialect-from-std/2347 after this lands! I think the completes that transition! (well, excepting the std.rank / memref.dim situation)

mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
1744–1745

Naming thing: I think we decided that these ops would be called something like tensor.slice/tensor.insert_slice (having the word "subtensor" and the "tensor." dialect prefix seems excessive). Can you rename them?

springerm updated this revision to Diff 353163.Jun 18 2021, 8:45 PM

rename ops: SubTensorOp --> SliceOP, SubTensorInsertOp --> InsertSliceOp

springerm edited the summary of this revision. (Show Details)Jun 18 2021, 8:46 PM
springerm updated this revision to Diff 353164.Jun 18 2021, 8:52 PM
springerm marked an inline comment as done.

minor updates

If we rename, I'd prefer we are consistent with vector; i.e. tensor.extract_slice, tensor.insert_slice.

ftynse accepted this revision.Jun 21 2021, 3:54 AM
springerm updated this revision to Diff 353378.Jun 21 2021, 8:04 AM

rename ops

springerm edited the summary of this revision. (Show Details)Jun 21 2021, 8:04 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 21 2021, 8:15 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.