19 if (
auto result = llvm::dyn_cast<OpResult>(*
this))
20 return result.getOwner();
25 if (
auto *op = getDefiningOp())
28 return llvm::cast<BlockArgument>(*this).getLoc();
32 if (
auto *op = getDefiningOp())
33 return op->setLoc(loc);
35 return llvm::cast<BlockArgument>(*this).setLoc(loc);
40 if (
auto *op = getDefiningOp())
42 return llvm::cast<BlockArgument>(*this).getOwner()->getParent();
48 return op->getBlock();
49 return llvm::cast<BlockArgument>(*this).getOwner();
53 return (
unsigned)std::distance(use_begin(), use_end());
57 return hasNItems(use_begin(), use_end(), n);
61 return hasNItemsOrMore(use_begin(), use_end(), n);
73 for (
OpOperand &use : llvm::make_early_inc_range(getUses())) {
74 if (exceptions.count(use.getOwner()) == 0)
83 for (
OpOperand &use : llvm::make_early_inc_range(getUses())) {
84 if (use.getOwner() != exceptedUser)
93 for (
OpOperand &use : llvm::make_early_inc_range(getUses()))
94 if (shouldReplace(use))
100 return llvm::any_of(getUsers(), [block](
Operation *user) {
107 getImpl()->shuffleUseList(indices);
129 if (
const auto *result = dyn_cast<InlineOpResult>(
this)) {
130 result += result->getResultNumber() + 1;
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;
195 unsigned OpResult::getNumInline(
unsigned numResults) {
201 unsigned OpResult::getNumTrailing(
unsigned numResults) {
204 return numResults <= maxInline ? 0 : numResults - maxInline;
218 return this - &getOwner()->getBlockOperands()[0];
227 return this - &getOwner()->getOpOperands()[0];
static Value min(ImplicitLocOpBuilder &builder, Value value, Value bound)
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 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.
Block * getBlock()
Returns the operation block that contains this operation.
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...
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
void setLoc(Location loc)
bool hasNUsesOrMore(unsigned n) const
Return true if this value has n uses or more.
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.
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.
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.
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.
This class provides the implementation for an operation result whose index cannot be represented "inl...
uint64_t outOfLineIndex
The trailing result number, or the offset from the beginning of the OutOfLineOpResult array.
Include the generated interface declarations.
This class provides the implementation for an operation result whose index can be represented "inline...