MLIR
21.0.0git
|
Stores the "key" associated with an ancestor. More...
Public Member Functions | |
AncestorKey (Operation *op) | |
Constructor for AncestorKey . More... | |
bool | operator< (const AncestorKey &key) const |
Overloaded operator < for AncestorKey . More... | |
Public Attributes | |
AncestorType | type |
Holds BLOCK_ARGUMENT , NON_CONSTANT_OP , or CONSTANT_OP , depending on the ancestor. More... | |
StringRef | opName |
Holds the op name of the ancestor if its type is NON_CONSTANT_OP or CONSTANT_OP . More... | |
Stores the "key" associated with an ancestor.
Definition at line 36 of file CommutativityUtils.cpp.
|
inline |
Constructor for AncestorKey
.
Definition at line 46 of file CommutativityUtils.cpp.
References BLOCK_ARGUMENT, CONSTANT_OP, mlir::Operation::getName(), mlir::OperationName::getStringRef(), mlir::Operation::hasTrait(), and NON_CONSTANT_OP.
|
inline |
Overloaded operator <
for AncestorKey
.
AncestorKeys of type BLOCK_ARGUMENT
are considered the smallest, those of type CONSTANT_OP
, the largest, and NON_CONSTANT_OP
types come in between. Within the types NON_CONSTANT_OP
and CONSTANT_OP
, the smaller ones are the ones with smaller op names (lexicographically).
TODO: Include other information like attributes, value type, etc., to enhance this comparison. For example, currently this comparison doesn't differentiate between cmpi sle
and cmpi sgt
or addi (in i32)
and addi (in i64)
. Such an enhancement should only be done if the need arises.
Definition at line 68 of file CommutativityUtils.cpp.
StringRef AncestorKey::opName |
Holds the op name of the ancestor if its type
is NON_CONSTANT_OP
or CONSTANT_OP
.
Else, holds "".
Definition at line 43 of file CommutativityUtils.cpp.
Referenced by operator<().
AncestorType AncestorKey::type |
Holds BLOCK_ARGUMENT
, NON_CONSTANT_OP
, or CONSTANT_OP
, depending on the ancestor.
Definition at line 39 of file CommutativityUtils.cpp.
Referenced by operator<().