[all-commits] [llvm/llvm-project] fa45b2: [mlir][Python] Add `__hash__` implementation for B...

Mike Urbach via All-commits all-commits at lists.llvm.org
Tue Dec 13 11:03:15 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa45b2fb2aefb5b942f022bc5a10ec97676a7868
      https://github.com/llvm/llvm-project/commit/fa45b2fb2aefb5b942f022bc5a10ec97676a7868
  Author: Mike Urbach <mikeurbach at gmail.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/test/python/ir/blocks.py

  Log Message:
  -----------
  [mlir][Python] Add `__hash__` implementation for Block.

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.

Differential Revision: https://reviews.llvm.org/D139599




More information about the All-commits mailing list