MLIR  19.0.0git
Public Member Functions | Public Attributes | List of all members
AncestorKey Struct Reference

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...
 

Detailed Description

Stores the "key" associated with an ancestor.

Definition at line 36 of file CommutativityUtils.cpp.

Constructor & Destructor Documentation

◆ AncestorKey()

AncestorKey::AncestorKey ( Operation op)
inline

Constructor for AncestorKey.

Definition at line 46 of file CommutativityUtils.cpp.

Member Function Documentation

◆ operator<()

bool AncestorKey::operator< ( const AncestorKey key) const
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.

References opName, and type.

Member Data Documentation

◆ opName

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<().

◆ type

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<().


The documentation for this struct was generated from the following file: