This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Fix operand type in `from_extent_tensor` in the shape dialect
ClosedPublic

Authored by frgossen on May 20 2020, 2:19 AM.

Details

Summary

The operand of from_extent_tensor is now of the same index type as the result
type of the inverse operation to_extent_tensor.

Depends On D80281

Diff Detail

Event Timeline

frgossen created this revision.May 20 2020, 2:19 AM
Herald added a reviewer: silvas. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
pifon2a accepted this revision.May 20 2020, 2:42 AM

I believe we have some use cases where extent tensors are i32 due to early lowering out of index type. @mravishankar might know how this is done in IREE. In the HLO dialect, we have the ScalarsToDimensionTensor op and that allows integer types and index.

In any case, the two ops should agree on their supported types.

silvas accepted this revision.May 20 2020, 11:54 AM

Thanks, this is a great cleanup! I happen to have added this before tensor<index> was allowed so I used i32, but now that doesn't make sense.

jpienaar accepted this revision.May 20 2020, 4:30 PM
This revision is now accepted and ready to land.May 20 2020, 4:30 PM
herhut accepted this revision.May 25 2020, 11:59 PM

Seems @silvas thinks this is ok, so I assume it will also work for IREE. Feel free go ahead an land.

This revision was automatically updated to reflect the committed changes.