[MLIR] [Python] Fix `Value.owner` to handle BlockArgs
authorJohn Demme <john.demme@microsoft.com>
Wed, 10 Aug 2022 02:37:04 +0000 (19:37 -0700)
committerJohn Demme <john.demme@microsoft.com>
Wed, 10 Aug 2022 02:37:04 +0000 (19:37 -0700)
commitd747a170a47dce64aefb906211e8aaed0c6bd6f6
tree1bbaaae8a3cecd684c739dadac036329aa3190d2
parentab4e5ed441d475ead43bc4ce1cdef842688292f4
[MLIR] [Python] Fix `Value.owner` to handle BlockArgs

Previously, calling `Value.owner()` would C++ assert in debug builds if
`Value` was a block argument. Additionally, the behavior was just wrong
in release builds. This patch adds support for BlockArg Values.
mlir/lib/Bindings/Python/IRCore.cpp
mlir/test/python/ir/value.py