This adds mlirOperationSetOperand to the IR C API, similar to the
function to get an operand.
In the Python API, this adds operands[index] = value syntax, similar
to the syntax to get an operand with operands[index].
| Paths 
 |  Differential  D101398  
[mlir] Support setting operand values in C and Python APIs. ClosedPublic Authored by mikeurbach on Apr 27 2021, 1:43 PM. 
Details Summary This adds mlirOperationSetOperand to the IR C API, similar to the In the Python API, this adds operands[index] = value syntax, similar 
Diff Detail 
 Event TimelineHerald added subscribers: shabalin, dcaballe, cota and 17 others.  ·  View Herald TranscriptApr 27 2021, 1:43 PM Comment Actions This is something @jdd and I will use in circt, and seemed generally useful upstream in mlir. However, we weren't sure about the addition of mlirOperationSetOperand to the C API. Are there deeper considerations preventing this from being added? Or is it just something that was demand-driven and has yet to be demanded? I've been testing this patch locally with some small programs for about a week and haven't found any issues with setting operands from Python via the proposed C API. mehdi_amini added inline comments. 
 This revision is now accepted and ready to land.Apr 27 2021, 1:54 PM Closed by commit rG63d16d06f5b8: [mlir] Support setting operand values in C and Python APIs. (authored by mikeurbach).  ·  Explain WhyApr 27 2021, 7:18 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 341057 mlir/include/mlir-c/IR.h
 mlir/lib/Bindings/Python/IRCore.cpp
 mlir/lib/Bindings/Python/PybindUtils.h
 mlir/lib/CAPI/IR/IR.cpp
 mlir/test/Bindings/Python/ir_operation.py
 mlir/test/CAPI/ir.c
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can you add coverage to this function through the C unitest?