mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 17:45:07 +08:00
An operation's operands are defined by the `arguments` field in the tablegen definition. mlir-tblgen generates accessors for them: `getXYZ()` and `setXYZ(...)` to set an operation's operands without knowing the operand's index, but it does not expose the operand index itself. Yet some use cases requires knowing the operand index that is now covered by just getters and setters. For instance: * Given an `mlir::OpOperand`, find out whether it is a specific argument (from the `arguments` field in the `.td` file) * For operation with variable number of operands (variadic, `AttrSizedOperandSegments`), get the value to pass to `getODSOperands` or `getODSOperandIndexAndLength`.
Multi-Level Intermediate Representation
See https://mlir.llvm.org/ for more information.