This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Introducing newtypes for ExprId, LatPointId, LatSetId
Needs ReviewPublic

Authored by wrengr on Mar 22 2023, 10:26 PM.



This commit performs the actual change from using typedefs to using newtypes. The ExprId, LatPointId, LatSetId types are especially simple, because: (1) the Merger has compete control over allocating them, and (2) client code only ever needs the equality operator (if it even needs that).

Depends On D146684

Diff Detail

Event Timeline

wrengr created this revision.Mar 22 2023, 10:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 10:26 PM
wrengr requested review of this revision.Mar 22 2023, 10:26 PM
wrengr updated this revision to Diff 508265.Mar 24 2023, 6:57 PM

Addressing the -Wmismatched-tags warnings on Debian.

Peiming added inline comments.Mar 27 2023, 1:30 PM

Why not supporting an implicit type conversion from the new types to unsigned (but not vice versa) so that they can be used directly for vector/array indices?

wrengr updated this revision to Diff 509497.Mar 29 2023, 4:32 PM

Postponing the migration of TensorId, LoopId, TensorLoopId into MergerNewtypes.h until D146691 (and D146693)

aartbik resigned from this revision.Aug 22 2023, 7:55 PM