This is an archive of the discontinued LLVM Phabricator instance.

[mlir][MemRef] Fix the simplification of extract_strided_metadata(subview)
ClosedPublic

Authored by qcolombet on Oct 17 2022, 1:08 PM.

Details

Summary

Prior to this patch we were wrongly applying the sub-strides to the computation of the final offset of the subview.

Put differently, we were computing the offset as:

offset = baseOffset + sum(subOffset#i * baseStrides#i * subSizes#i)

Whereas we should be doing:

offset = baseOffset + sum(subOffset#i * baseStrides#i)

I.e., drop the subSizes#i term from the sum.

Diff Detail

Event Timeline

qcolombet created this revision.Oct 17 2022, 1:08 PM
qcolombet requested review of this revision.Oct 17 2022, 1:08 PM
ftynse accepted this revision.Oct 17 2022, 11:59 PM

Thanks! The affine now also looks similar to what we have elsewhere for strided formats.

This revision is now accepted and ready to land.Oct 17 2022, 11:59 PM
This revision was landed with ongoing or failed builds.Oct 18 2022, 12:38 PM
This revision was automatically updated to reflect the committed changes.