This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NFC] Move getOrCreateRanges to ViewLikeInterface
AbandonedPublic

Authored by springerm on Jun 21 2021, 11:13 PM.

Details

Summary

getOrCreateRanges is a helper function for ViewLikeInterface. This function is currently defined in the MemRefDialect (and pre-declared in the TensorDialect).

Depends On D104676

Diff Detail

Event Timeline

springerm created this revision.Jun 21 2021, 11:13 PM
springerm requested review of this revision.Jun 21 2021, 11:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2021, 11:13 PM
rriddle requested changes to this revision.Jun 21 2021, 11:22 PM

This is adding a dialect dependency to an interface, which is generally a code smell for something being off. Why does this interface need to depend on the standard dialect?

mlir/lib/Interfaces/CMakeLists.txt
52 ↗(On Diff #353557)

Interfaces generally should not depend on dialects.

This revision now requires changes to proceed.Jun 21 2021, 11:22 PM

This is adding a dialect dependency to an interface, which is generally a code smell for something being off. Why does this interface need to depend on the standard dialect?

The purpose of this revision is to move getOrCreateRanges from MemRefOps.cpp to some other place. (As part of cleaning up MemRefOps.cpp.) This function does not conceptually belong to the MemRef dialect. Also, this function is predeclared in MemRef dialect and in the Tensor dialect, but only defined in the MemRef dialect.

Actually, it doesn't necessarily have to go to ViewLikeInterface.cpp. Moving it into a util file...

address comments

small update

springerm abandoned this revision.Jun 22 2021, 5:54 PM