This is an archive of the discontinued LLVM Phabricator instance.

[mlir][MemRef] Fix MemRefCastOpLowering for 32 bit index type.
ClosedPublic

Authored by akuegel on Feb 11 2022, 2:46 AM.

Details

Summary

The lowering creates llvm.insertvalue with the rank value, so it needs to use
index type instead of 64 bit integer type. Otherwise, we get an error:

llvm.insertvalue' op Type mismatch: cannot insert 'i64' into '!llvm.struct<(i32, ptr<i8>)>'

Diff Detail

Event Timeline

akuegel created this revision.Feb 11 2022, 2:46 AM
akuegel requested review of this revision.Feb 11 2022, 2:46 AM

FYI, I found this while trying to add a test case for the memref.copy lowering. We run memref-to-llvm.mlir also with the index-bitwidth=32 option.

akuegel retitled this revision from [mlir][MemRef] Fix MemRefCastOpLowering for 32 index type. to [mlir][MemRef] Fix MemRefCastOpLowering for 32 bit index type..Feb 11 2022, 3:27 AM
bkramer accepted this revision.Feb 11 2022, 3:32 AM

Makes sense to me

This revision is now accepted and ready to land.Feb 11 2022, 3:32 AM