This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferize] Insert memref.cast ops during finalizing pass
ClosedPublic

Authored by springerm on Jan 23 2022, 7:42 AM.

Details

Summary

The pass can currently not handle to_memref(to_tensor(x)) folding where a cast is necessary. This is required with the new unified bufferization. There is already a canonicalization pattern that handles such foldings and it should be used during this pass.

Depends On D118243

Diff Detail

Event Timeline

springerm created this revision.Jan 23 2022, 7:42 AM
springerm requested review of this revision.Jan 23 2022, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2022, 7:42 AM
nicolasvasilache requested changes to this revision.Jan 24 2022, 2:03 AM

This is scary on many levels, we don't want to propagate this.
Can we turn this into an assertion and be very loud if something does not comply?

This revision now requires changes to proceed.Jan 24 2022, 2:03 AM

Ok this thing is actually never used in the preferred case, it can only trigger if one uses the old bufferization mixed in which should be deprecated in the future.

This revision is now accepted and ready to land.Jan 27 2022, 12:03 AM
springerm updated this revision to Diff 403551.Jan 27 2022, 2:06 AM

add test case

This revision was landed with ongoing or failed builds.Jan 27 2022, 2:11 AM
This revision was automatically updated to reflect the committed changes.