Hashable module
hashable_module
HashableModule
dataclass
Bases: Hashable
A class wrapping a ModuleOp, that forwards to structural equality checking for ==.
The module in this class should not be mutated.
Source code in xdsl/utils/hashable_module.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
module: ModuleOp
instance-attribute
__init__(module: ModuleOp) -> None
__eq__(other: object) -> bool
Source code in xdsl/utils/hashable_module.py
17 18 19 20 | |
__hash__() -> int
The hash of the module is a hash of the ordered combination of operation names. As most transformations on IR modify at least one operation, this should be enough to minimise collisions.
Source code in xdsl/utils/hashable_module.py
22 23 24 25 26 27 28 29 30 31 | |