18 auto branchOp = dyn_cast<BranchOpInterface>(caller);
19 assert(branchOp &&
"expected that all callers implement BranchOpInterface");
20 auto it = llvm::find(caller->getSuccessors(), block);
21 assert(it != caller->getSuccessors().end() &&
"could not find successor");
22 int64_t successorIdx = std::distance(caller->getSuccessors().begin(), it);
25 "produced operands not supported");
26 int64_t operandIndex =
29 result.push_back(&caller->getOpOperand(operandIndex));
This class represents an argument of a Block.
Block * getOwner() const
Returns the block that owns this argument.
unsigned getArgNumber() const
Returns the number of this argument.
Block represents an ordered list of Operations.
user_range getUsers() const
Returns a range of all users.
unsigned getBeginOperandIndex() const
Return the operand index of the first element of this range.
Operation is the basic unit of execution within MLIR.
This class models how operands are forwarded to block arguments in control flow.
unsigned getProducedOperandCount() const
Returns the amount of operands that are produced internally by the operation.
OperandRange getForwardedOperands() const
Get the range of operands that are simply forwarded to the successor.
SmallVector< OpOperand * > getCallerOpOperands(BlockArgument bbArg)
Return a list of operands that are forwarded to the given block argument.
Include the generated interface declarations.