This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Python] Add `__hash__` implementation for Block.
ClosedPublic

Authored by mikeurbach on Dec 7 2022, 6:18 PM.

Details

Summary

This allows us to hash Blocks and use them in sets or parts of larger
hashable objects. The implementation is the same as other core IR
constructs: the C API object's pointer is hashed.

Diff Detail

Event Timeline

mikeurbach created this revision.Dec 7 2022, 6:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 6:18 PM
mikeurbach requested review of this revision.Dec 7 2022, 6:18 PM

I think this change may be trivial enough to land without pre-merge approval. I've been testing it in a downstream project and it seems to work as expected.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 13 2022, 11:03 AM
This revision was automatically updated to reflect the committed changes.