This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Define an order on `Value`s
AbandonedPublic

Authored by frgossen on Oct 27 2020, 6:04 AM.

Details

Summary

A default order on Values allows for its use in, e.g.,
llvm::EquivalenceClasses.

Diff Detail

Event Timeline

frgossen created this revision.Oct 27 2020, 6:04 AM
frgossen requested review of this revision.Oct 27 2020, 6:04 AM

This order won't be stable between runs though, so any test depends on the ordering would be flaky. Why not add a simple wrapper class locally where you need this? Keeps it local to where the ordering doesn't matter and avoids folks accidentally relying on it accidentally.

I typically use getAsOpaquePointer() to get a void* and then place that in the collection at hands. That is unstable too but only locally where the context is clear.

frgossen abandoned this revision.Oct 28 2020, 2:47 AM

Thanks! Will do that