Commit a4f31cc
authored
[mlir-tblgen] Emit named operand indices (#146839)
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`.1 parent a178949 commit a4f31cc
File tree
2 files changed
+22
-0
lines changed- mlir
- test/mlir-tblgen
- tools/mlir-tblgen
2 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2223 | 2223 | | |
2224 | 2224 | | |
2225 | 2225 | | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
2226 | 2237 | | |
2227 | 2238 | | |
2228 | 2239 | | |
| |||
0 commit comments