19 if (
auto result = llvm::dyn_cast<OpResult>(*
this))
28 return llvm::cast<BlockArgument>(*this).getLoc();
33 return op->setLoc(loc);
35 return llvm::cast<BlockArgument>(*this).setLoc(loc);
42 return llvm::cast<BlockArgument>(*this).getOwner()->getParent();
48 return op->getBlock();
49 return llvm::cast<BlockArgument>(*this).getOwner();
74 if (exceptions.count(use.getOwner()) == 0)
84 if (use.getOwner() != exceptedUser)
94 if (shouldReplace(use))
129 if (
const auto *
result = dyn_cast<InlineOpResult>(
this)) {
139 const auto *inlineIt =
reinterpret_cast<const InlineOpResult *
>(outOfLineIt);
160 if (
auto *inlineResult = dyn_cast<InlineOpResult>(
this)) {
171 intptr_t leftBeforeTrailing =
173 if (leftBeforeTrailing >= offset)
174 return inlineResult - offset;
184 result = inlineResult - leftBeforeTrailing;
185 offset -= leftBeforeTrailing;
195unsigned OpResult::getNumInline(
unsigned numResults) {
201unsigned OpResult::getNumTrailing(
unsigned numResults) {
204 return numResults <= maxInline ? 0 : numResults - maxInline;
unsigned getOperandNumber()
Return which operand this is in the BlockOperand list of the Operation.
static IRObjectWithUseList< BlockOperand > * getUseList(Block *value)
Provide the use list that is attached to the given block.
Block represents an ordered list of Operations.
This class represents a single IR object that contains a use list.
void shuffleUseList(ArrayRef< unsigned > indices)
Shuffle the use-list chain according to the provided indices vector, which need to represent a valid ...
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class represents an operand of an operation.
unsigned getOperandNumber()
Return which operand this is in the OpOperand list of the Operation.
Operation is the basic unit of execution within MLIR.
MutableArrayRef< BlockOperand > getBlockOperands()
Block * getBlock()
Returns the operation block that contains this operation.
MutableArrayRef< OpOperand > getOpOperands()
This class contains a list of basic blocks and a link to the parent operation it is attached to.
Region * getParentRegion()
Return the region containing this region or nullptr if the region is attached to a top-level operatio...
constexpr Value(detail::ValueImpl *impl=nullptr)
use_iterator use_end() const
void setLoc(Location loc)
bool hasNUsesOrMore(unsigned n) const
Return true if this value has n uses or more.
detail::ValueImpl * getImpl() const
void replaceUsesWithIf(Value newValue, function_ref< bool(OpOperand &)> shouldReplace)
Replace all uses of 'this' value with 'newValue' if the given callback returns true.
void shuffleUseList(ArrayRef< unsigned > indices)
Shuffle the use list order according to the provided indices.
use_range getUses() const
Returns a range of all uses, which is useful for iterating over all uses.
Block * getParentBlock()
Return the Block in which this Value is defined.
void replaceAllUsesExcept(Value newValue, const SmallPtrSetImpl< Operation * > &exceptions)
Replace all uses of 'this' value with 'newValue', updating anything in the IR that uses 'this' to use...
unsigned getNumUses() const
This method computes the number of uses of this Value.
bool hasNUses(unsigned n) const
Return true if this Value has exactly n uses.
user_range getUsers() const
bool isUsedOutsideOfBlock(Block *block) const
Returns true if the value is used outside of the given block.
Location getLoc() const
Return the location of this value.
Operation * getDefiningOp() const
If this value is the result of an operation, return the operation that defines it.
Region * getParentRegion()
Return the Region in which this Value is defined.
use_iterator use_begin() const
Operation * getOwner() const
Return the owner of this operand.
This class provides the implementation for an operation result.
OpResultImpl * getNextResultAtOffset(intptr_t offset)
Returns the next operation result at offset after this result.
Operation * getOwner() const
Returns the parent operation of this result.
static unsigned getMaxInlineResults()
Returns the maximum number of results that can be stored inline.
uint64_t outOfLineIndex
The trailing result number, or the offset from the beginning of the OutOfLineOpResult array.
@ OutOfLineOpResult
The next kind represents a 'out-of-line' operation result.
@ InlineOpResult
The first N kinds are all inline operation results.
Include the generated interface declarations.
llvm::function_ref< Fn > function_ref