Skip to content

Commit 5678372

Browse files
committed
[MLIR][DRR] Rename OperandIndexOrNumValues to ArgIndexOrNumValues (NFC)
Signed-off-by: Xiaomin Liu <[email protected]>
1 parent 6e5ee4a commit 5678372

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

mlir/include/mlir/TableGen/Pattern.h

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,12 @@ class SymbolInfoMap {
276276
// Structure to uniquely distinguish different locations of the symbols.
277277
//
278278
// * If a symbol is defined as an operand of an operation, `dag` specifies
279-
// the DAG of the operation, `operandIndexOrNumValues` specifies the
280-
// operand index, and `variadicSubIndex` must be set to `std::nullopt`.
279+
// the DAG of the operation, `argIndexOrNumValues` specifies the
280+
// index, and `variadicSubIndex` must be set to `std::nullopt`.
281281
//
282282
// * If a symbol is defined in a `variadic` DAG, `dag` specifies the DAG
283-
// of the parent operation, `operandIndexOrNumValues` specifies the
284-
// declared operand index of the variadic operand in the parent
285-
// operation.
283+
// of the parent operation, `argIndexOrNumValues` specifies the
284+
// declared index of the variadic operand in the parent operation.
286285
//
287286
// - If the symbol is defined as a result of `variadic` DAG, the
288287
// `variadicSubIndex` must be set to `std::nullopt`, which means that
@@ -292,9 +291,9 @@ class SymbolInfoMap {
292291
// be set to the index within the variadic sub-operand list.
293292
//
294293
// * If a symbol is defined in a `either` DAG, `dag` specifies the DAG
295-
// of the parent operation, `operandIndexOrNumValues` specifies the
296-
// operand index in the parent operation (not necessary the index in the
297-
// DAG).
294+
// of the parent operation, `argIndexOrNumValues` specifies the
295+
// operand's index in the parent operation (not necessarily its index
296+
// in the DAG).
298297
//
299298
// * If a symbol is defined as a result, specifies the number of returning
300299
// value.
@@ -347,17 +346,17 @@ class SymbolInfoMap {
347346
// DagNode and DagLeaf are accessed by value which means it can't be used
348347
// as identifier here. Use an opaque pointer type instead.
349348
const void *dag;
350-
int operandIndexOrNumValues;
349+
int argIndexOrNumValues;
351350
std::optional<int> variadicSubIndex;
352351

353-
DagAndConstant(const void *dag, int operandIndexOrNumValues,
352+
DagAndConstant(const void *dag, int argIndexOrNumValues,
354353
std::optional<int> variadicSubIndex)
355-
: dag(dag), operandIndexOrNumValues(operandIndexOrNumValues),
354+
: dag(dag), argIndexOrNumValues(argIndexOrNumValues),
356355
variadicSubIndex(variadicSubIndex) {}
357356

358357
bool operator==(const DagAndConstant &rhs) const {
359358
return dag == rhs.dag &&
360-
operandIndexOrNumValues == rhs.operandIndexOrNumValues &&
359+
argIndexOrNumValues == rhs.argIndexOrNumValues &&
361360
variadicSubIndex == rhs.variadicSubIndex;
362361
}
363362
};
@@ -385,11 +384,11 @@ class SymbolInfoMap {
385384
return SymbolInfo(nullptr, Kind::Attr, std::nullopt);
386385
}
387386
static SymbolInfo
388-
getOperand(DagNode node, const Operator *op, int operandIndex,
387+
getOperand(DagNode node, const Operator *op, int index,
389388
std::optional<int> variadicSubIndex = std::nullopt) {
390-
return SymbolInfo(op, Kind::Operand,
391-
DagAndConstant(node.getAsOpaquePointer(), operandIndex,
392-
variadicSubIndex));
389+
return SymbolInfo(
390+
op, Kind::Operand,
391+
DagAndConstant(node.getAsOpaquePointer(), index, variadicSubIndex));
393392
}
394393
static SymbolInfo getResult(const Operator *op) {
395394
return SymbolInfo(op, Kind::Result, std::nullopt);
@@ -427,10 +426,10 @@ class SymbolInfoMap {
427426
const char *separator) const;
428427

429428
// The argument index (for `Attr` and `Operand` only)
430-
int getArgIndex() const { return dagAndConstant->operandIndexOrNumValues; }
429+
int getArgIndex() const { return dagAndConstant->argIndexOrNumValues; }
431430

432431
// The number of values in the MultipleValue
433-
int getSize() const { return dagAndConstant->operandIndexOrNumValues; }
432+
int getSize() const { return dagAndConstant->argIndexOrNumValues; }
434433

435434
// The variadic sub-operands index (for variadic `Operand` only)
436435
std::optional<int> getVariadicSubIndex() const {

0 commit comments

Comments
 (0)