aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bindings/Python/IRModule.h
diff options
context:
space:
mode:
authorPeter Hawkins <phawkins@google.com>2025-01-22 08:41:31 -0500
committerGitHub <noreply@github.com>2025-01-22 05:41:31 -0800
commitff0f1dd341cb2fdc1281a14413b3aa93bf9a20c7 (patch)
tree2d3a8e2ed26722304f6e42d544f2044bdb38ae50 /mlir/lib/Bindings/Python/IRModule.h
parent7986e0cad10f3bf9efbbe31110ece68af5cb8751 (diff)
downloadllvm-ff0f1dd341cb2fdc1281a14413b3aa93bf9a20c7.zip
llvm-ff0f1dd341cb2fdc1281a14413b3aa93bf9a20c7.tar.gz
llvm-ff0f1dd341cb2fdc1281a14413b3aa93bf9a20c7.tar.bz2
[mlir:python] Small optimization to get_op_result_or_results. (#123866)
* We can call .results without figuring out whether we have an Operation or an OpView, and that's likely the common case anyway. * If we have one or more results, we can return them directly, with no need for a call to get_op_result_or_value. We're guaranteed that .results returns a PyOpResultList, so we have either an OpResult or sequence of OpResults, just as the API expects. This saves a few 100ms during IR construction in an LLM JAX benchmark.
Diffstat (limited to 'mlir/lib/Bindings/Python/IRModule.h')
0 files changed, 0 insertions, 0 deletions