diff options
author | Peter Hawkins <phawkins@google.com> | 2025-01-24 09:26:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-24 06:26:28 -0800 |
commit | acde3f722ff3766f6f793884108d342b78623fe4 (patch) | |
tree | 61d63b9df44ccf448952791363d8a869cb8df651 /mlir/lib/Bindings/Python/IRModule.h | |
parent | 77c780d64b950d6850d5ec1ee06cd0c21b38b89e (diff) | |
download | llvm-acde3f722ff3766f6f793884108d342b78623fe4.zip llvm-acde3f722ff3766f6f793884108d342b78623fe4.tar.gz llvm-acde3f722ff3766f6f793884108d342b78623fe4.tar.bz2 |
[mlir:python] Compute get_op_result_or_value in PyOpView's constructor. (#123953)
This logic is in the critical path for constructing an operation from
Python. It is faster to compute this in C++ than it is in Python, and it
is a minor change to do this.
This change also alters the API contract of
_ods_common.get_op_results_or_values to avoid calling
get_op_result_or_value on each element of a sequence, since the C++ code
will now do this.
Most of the diff here is simply reordering the code in IRCore.cpp.
Diffstat (limited to 'mlir/lib/Bindings/Python/IRModule.h')
-rw-r--r-- | mlir/lib/Bindings/Python/IRModule.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h index fd70ac7..dd6e7ef 100644 --- a/mlir/lib/Bindings/Python/IRModule.h +++ b/mlir/lib/Bindings/Python/IRModule.h @@ -686,7 +686,7 @@ public: /// Creates an operation. See corresponding python docstring. static nanobind::object create(std::string_view name, std::optional<std::vector<PyType *>> results, - std::optional<std::vector<PyValue *>> operands, + llvm::ArrayRef<MlirValue> operands, std::optional<nanobind::dict> attributes, std::optional<std::vector<PyBlock *>> successors, int regions, DefaultingPyLocation location, const nanobind::object &ip, |