MLIR
20.0.0git
|
This class provides a mutable adaptor for a range of operands. More...
#include "mlir/IR/ValueRange.h"
Public Types | |
using | OperandSegment = std::pair< unsigned, NamedAttribute > |
A pair of a named attribute corresponding to an operand segment attribute, and the index within that attribute. More... | |
Public Member Functions | |
MutableOperandRange (Operation *owner, unsigned start, unsigned length, ArrayRef< OperandSegment > operandSegments=std::nullopt) | |
Construct a new mutable range from the given operand, operand start index, and range length. More... | |
MutableOperandRange (Operation *owner) | |
MutableOperandRange (OpOperand &opOperand) | |
Construct a new mutable range for the given OpOperand. More... | |
MutableOperandRange | slice (unsigned subStart, unsigned subLen, std::optional< OperandSegment > segment=std::nullopt) const |
Slice this range into a sub range, with the additional operand segment. More... | |
void | append (ValueRange values) |
Append the given values to the range. More... | |
void | assign (ValueRange values) |
Assign this range to the given values. More... | |
void | assign (Value value) |
Assign the range to the given value. More... | |
void | erase (unsigned subStart, unsigned subLen=1) |
Erase the operands within the given sub-range. More... | |
void | clear () |
Clear this range and erase all of the operands. More... | |
unsigned | size () const |
Returns the current size of the range. More... | |
bool | empty () const |
Returns if the current range is empty. More... | |
OperandRange | getAsOperandRange () const |
Explicit conversion to an OperandRange. More... | |
operator OperandRange () const | |
Allow implicit conversion to an OperandRange. More... | |
operator MutableArrayRef< OpOperand > () const | |
Allow implicit conversion to a MutableArrayRef. More... | |
Operation * | getOwner () const |
Returns the owning operation. More... | |
MutableOperandRangeRange | split (NamedAttribute segmentSizes) const |
Split this range into a set of contiguous subranges using the given elements attribute, which contains the sizes of the sub ranges. More... | |
OpOperand & | operator[] (unsigned index) const |
Returns the OpOperand at the given index. More... | |
MutableArrayRef< OpOperand >::iterator | begin () const |
Iterators enumerate OpOperands. More... | |
MutableArrayRef< OpOperand >::iterator | end () const |
This class provides a mutable adaptor for a range of operands.
It allows for setting, inserting, and erasing operands from the given range.
Definition at line 115 of file ValueRange.h.
using mlir::MutableOperandRange::OperandSegment = std::pair<unsigned, NamedAttribute> |
A pair of a named attribute corresponding to an operand segment attribute, and the index within that attribute.
The attribute should correspond to a dense i32 array attr.
Definition at line 120 of file ValueRange.h.
MutableOperandRange::MutableOperandRange | ( | Operation * | owner, |
unsigned | start, | ||
unsigned | length, | ||
ArrayRef< OperandSegment > | operandSegments = std::nullopt |
||
) |
Construct a new mutable range from the given operand, operand start index, and range length.
operandSegments
is an optional set of operand segments to be updated when mutating the operand list.
Definition at line 430 of file OperationSupport.cpp.
References mlir::Operation::getNumOperands().
MutableOperandRange::MutableOperandRange | ( | Operation * | owner | ) |
Definition at line 437 of file OperationSupport.cpp.
MutableOperandRange::MutableOperandRange | ( | OpOperand & | opOperand | ) |
Construct a new mutable range for the given OpOperand.
Definition at line 441 of file OperationSupport.cpp.
void MutableOperandRange::append | ( | ValueRange | values | ) |
Append the given values to the range.
Definition at line 459 of file OperationSupport.cpp.
References mlir::Operation::insertOperands().
Referenced by mlir::SuccessorOperands::append(), and transformToReduceLoop().
void MutableOperandRange::assign | ( | Value | value | ) |
Assign the range to the given value.
Definition at line 474 of file OperationSupport.cpp.
References mlir::Operation::setOperand(), and mlir::Operation::setOperands().
void MutableOperandRange::assign | ( | ValueRange | values | ) |
Assign this range to the given values.
Definition at line 467 of file OperationSupport.cpp.
References mlir::Operation::setOperands().
Referenced by mlir::bufferization::bufferizeBlockSignature().
MutableArrayRef< OpOperand >::iterator MutableOperandRange::begin | ( | ) | const |
Iterators enumerate OpOperands.
Definition at line 540 of file OperationSupport.cpp.
References mlir::Operation::getOpOperands().
void MutableOperandRange::clear | ( | ) |
Clear this range and erase all of the operands.
Definition at line 493 of file OperationSupport.cpp.
References mlir::Operation::eraseOperands().
|
inline |
Returns if the current range is empty.
Definition at line 156 of file ValueRange.h.
References size().
MutableArrayRef< OpOperand >::iterator MutableOperandRange::end | ( | ) | const |
Definition at line 544 of file OperationSupport.cpp.
References mlir::Operation::getOpOperands().
void MutableOperandRange::erase | ( | unsigned | subStart, |
unsigned | subLen = 1 |
||
) |
Erase the operands within the given sub-range.
Definition at line 484 of file OperationSupport.cpp.
References mlir::Operation::eraseOperands().
Referenced by mlir::SuccessorOperands::erase(), and foldCstValueToCstAttrBasis().
OperandRange MutableOperandRange::getAsOperandRange | ( | ) | const |
Explicit conversion to an OperandRange.
Definition at line 501 of file OperationSupport.cpp.
References mlir::Operation::getOperands().
Referenced by fuse(), and transformToStructuredCFBranches().
|
inline |
Returns the owning operation.
Definition at line 168 of file ValueRange.h.
MutableOperandRange::operator MutableArrayRef< OpOperand > | ( | ) | const |
Allow implicit conversion to a MutableArrayRef.
Definition at line 510 of file OperationSupport.cpp.
References mlir::Operation::getOpOperands().
MutableOperandRange::operator OperandRange | ( | ) | const |
Allow implicit conversion to an OperandRange.
Definition at line 506 of file OperationSupport.cpp.
OpOperand & MutableOperandRange::operator[] | ( | unsigned | index | ) | const |
Returns the OpOperand at the given index.
Definition at line 535 of file OperationSupport.cpp.
References mlir::Operation::getOpOperand().
|
inline |
Returns the current size of the range.
Definition at line 153 of file ValueRange.h.
Referenced by empty(), mlir::SuccessorOperands::size(), and transformToReduceLoop().
MutableOperandRange MutableOperandRange::slice | ( | unsigned | subStart, |
unsigned | subLen, | ||
std::optional< OperandSegment > | segment = std::nullopt |
||
) | const |
Slice this range into a sub range, with the additional operand segment.
Definition at line 448 of file OperationSupport.cpp.
Referenced by mlir::SuccessorOperands::slice().
MutableOperandRangeRange MutableOperandRange::split | ( | NamedAttribute | segmentSizes | ) | const |
Split this range into a set of contiguous subranges using the given elements attribute, which contains the sizes of the sub ranges.
Definition at line 515 of file OperationSupport.cpp.