This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Memref] Introduce a memref::ExtractAlignedPointerAsIndexOp
ClosedPublic

Authored by nicolasvasilache on Sep 26 2022, 8:48 AM.

Details

Summary

As experience with memref::ExtractStridedMetadataOp grows we are
still missing a simple way to extract the pointer held by a memref
and lower to different backednds (LLVM, SPIRV, library calls).

This revision introduces a memref.extract_aligned_pointer_as_index that
returns an index containing the aligned pointer of the strided memref.

This operation is intended to be used solely as step during lowering,
it has no side effects. A reverse operation that creates a memref from
an index interpreted as a pointer is explicitly discouraged.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Sep 26 2022, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 8:48 AM
ftynse accepted this revision.Sep 26 2022, 8:50 AM

Looks useful. Can we have a trivial test? I see most of the things are generated here, but at least the for the fact that the op got registered.

This revision is now accepted and ready to land.Sep 26 2022, 8:50 AM
This revision was landed with ongoing or failed builds.Sep 26 2022, 8:55 AM
This revision was automatically updated to reflect the committed changes.