This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add unsigned version of index_cast
ClosedPublic

Authored by ThomasRaoux on Oct 3 2022, 10:36 AM.

Details

Summary

This is required to be able to cast integer type to a potential larger index using zero-extend cast.

There is a larger change under discussion to move index ops in a separate dialect: https://discourse.llvm.org/t/rfc-index-dialect/65540/
Based on timing of this work this patch can be included as part of this effort but as a short term solution we may want to add this op to arithmetic dialect for now in order to fill the gap.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Oct 3 2022, 10:36 AM
ThomasRaoux requested review of this revision.Oct 3 2022, 10:36 AM
stellaraccident accepted this revision.Oct 3 2022, 10:45 AM
stellaraccident added a subscriber: stellaraccident.

I'm personally ok with this patch. If we decide to go forward with the index dialect, it will come with a transition plan for index-in-arith, and it doesn't seem like this makes that harder. If anything, it makes it easier to specify what the transition path is for the existing index cast ops.

Marking as accepted to note my agreement. Please wait for consensus to land.

This revision is now accepted and ready to land.Oct 3 2022, 10:45 AM
Mogball accepted this revision.Oct 3 2022, 11:08 AM
This revision was automatically updated to reflect the committed changes.