This is an archive of the discontinued LLVM Phabricator instance.

[mlir][MemRef] Add pattern that forwards constant strided metadata.
ClosedPublic

Authored by nicolasvasilache on Sep 25 2022, 8:01 AM.

Details

Summary

memref.extract_strided_metadata can forward constants independently of the
exsistence of other operations such as subview or reshape.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Sep 25 2022, 8:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2022, 8:01 AM
chelini added inline comments.Sep 26 2022, 3:48 AM
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
16

Why is this needed?

mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp
457

Introduces the following warning: warning: extra ';' outside of a function is incompatible with C++98.

ftynse added a subscriber: ftynse.Sep 26 2022, 5:54 AM
ftynse added inline comments.
mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp
434

Please document top-level entities.

470

(void)res;

This will break Werror bots otherwise.

mlir/test/Dialect/MemRef/simplify-extract-strided-metadata.mlir
7–10

Any reason why this needs to be a dag?

ftynse accepted this revision.Sep 26 2022, 5:54 AM
This revision is now accepted and ready to land.Sep 26 2022, 5:54 AM
nicolasvasilache marked 5 inline comments as done.Sep 26 2022, 8:24 AM
nicolasvasilache added inline comments.
mlir/test/Dialect/MemRef/simplify-extract-strided-metadata.mlir
7–10

I wouldn't want to encode an expected ordering of constant materialization (or expect a brittle MLIR enforced order of constants), any order is fine.

nicolasvasilache marked an inline comment as done.

Address'nRebase

This revision was landed with ongoing or failed builds.Sep 26 2022, 8:34 AM
This revision was automatically updated to reflect the committed changes.