This is an archive of the discontinued LLVM Phabricator instance.

[mlir][MemRef] Change the anchor point of a reshapeLikeOp pattern
ClosedPublic

Authored by qcolombet on Oct 20 2022, 3:36 PM.

Details

Summary

Essentially, this patches changes the anchor point of the extract_strided_metadata(reshapeLikeOp) pattern from extract_strided_metadata to reshapeLikeOp.

In details, this means that instead of replacing:

base, offset, sizes, strides =
extract_strided_metadata(reshapeLikeOp(src))

With

base, offset = extract_strided_metadata(src)
sizes = <some math>
strides = <some math>

We replace only the reshapeLikeOp part and connect it back with a reinterpret_cast:

val = reshapeLikeOp(src)

>

base, offset, ... = extract_strided_metadata(src)
sizes = <some math>
strides = <some math>
val = reinterpret_cast base, offset, sizes, strides

Diff Detail

Event Timeline

qcolombet created this revision.Oct 20 2022, 3:36 PM
qcolombet requested review of this revision.Oct 20 2022, 3:36 PM
nicolasvasilache accepted this revision.Oct 27 2022, 8:27 AM
This revision is now accepted and ready to land.Oct 27 2022, 8:27 AM
This revision was landed with ongoing or failed builds.Nov 14 2022, 11:06 AM
This revision was automatically updated to reflect the committed changes.