This is an archive of the discontinued LLVM Phabricator instance.

[mlir][std] Canonicalize a dim(memref_reshape) into a load from the shape operand
ClosedPublic

Authored by herhut on Nov 20 2020, 2:22 AM.

Details

Summary

This canonicalization helps propagate shape information through the program.

Diff Detail

Event Timeline

herhut created this revision.Nov 20 2020, 2:22 AM
herhut requested review of this revision.Nov 20 2020, 2:22 AM
ftynse accepted this revision.Nov 20 2020, 2:30 AM
ftynse added inline comments.
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
1573

Nit: I don't remember if the pattern applicator has an InsertGuard or if the patterns are supposed to preserve the insertion point.

This revision is now accepted and ready to land.Nov 20 2020, 2:30 AM
rriddle added inline comments.Nov 20 2020, 2:37 AM
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
1573

There is no guard, but the applicator always updates the position before applying each pattern so it should be fine.

frgossen accepted this revision.Nov 20 2020, 2:50 AM

Thanks!