Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
Show All 21 Lines | |||||
def BranchOpInterface : OpInterface<"BranchOpInterface"> { | def BranchOpInterface : OpInterface<"BranchOpInterface"> { | ||||
let description = [{ | let description = [{ | ||||
This interface provides information for branching terminator operations, | This interface provides information for branching terminator operations, | ||||
i.e. terminator operations with successors. | i.e. terminator operations with successors. | ||||
}]; | }]; | ||||
let methods = [ | let methods = [ | ||||
InterfaceMethod<[{ | InterfaceMethod<[{ | ||||
Returns a set of values that correspond to the arguments to the | Returns a mutable range of operands that correspond to the arguments of | ||||
successor at the given index. Returns None if the operands to the | successor at the given index. Returns None if the operands to the | ||||
successor are non-materialized values, i.e. they are internal to the | successor are non-materialized values, i.e. they are internal to the | ||||
operation. | operation. | ||||
}], | }], | ||||
"Optional<OperandRange>", "getSuccessorOperands", (ins "unsigned":$index) | "Optional<MutableOperandRange>", "getMutableSuccessorOperands", | ||||
(ins "unsigned":$index) | |||||
>, | >, | ||||
InterfaceMethod<[{ | InterfaceMethod<[{ | ||||
Return true if this operation can erase an operand to a successor block. | Returns a range of operands that correspond to the arguments of | ||||
}], | successor at the given index. Returns None if the operands to the | ||||
"bool", "canEraseSuccessorOperand" | successor are non-materialized values, i.e. they are internal to the | ||||
>, | operation. | ||||
InterfaceMethod<[{ | |||||
Erase the operand at `operandIndex` from the `index`-th successor. This | |||||
should only be called if `canEraseSuccessorOperand` returns true. | |||||
}], | }], | ||||
"void", "eraseSuccessorOperand", | "Optional<OperandRange>", "getSuccessorOperands", | ||||
(ins "unsigned":$index, "unsigned":$operandIndex), [{}], | (ins "unsigned":$index), [{}], [{ | ||||
/*defaultImplementation=*/[{ | |||||
ConcreteOp *op = static_cast<ConcreteOp *>(this); | ConcreteOp *op = static_cast<ConcreteOp *>(this); | ||||
Optional<OperandRange> operands = op->getSuccessorOperands(index); | auto operands = op->getMutableSuccessorOperands(index); | ||||
assert(operands && "unable to query operands for successor"); | return operands ? Optional<OperandRange>(*operands) : llvm::None; | ||||
detail::eraseBranchSuccessorOperand(*operands, operandIndex, *op); | |||||
}] | }] | ||||
>, | >, | ||||
InterfaceMethod<[{ | InterfaceMethod<[{ | ||||
Returns the `BlockArgument` corresponding to operand `operandIndex` in | Returns the `BlockArgument` corresponding to operand `operandIndex` in | ||||
some successor, or None if `operandIndex` isn't a successor operand | some successor, or None if `operandIndex` isn't a successor operand | ||||
index. | index. | ||||
}], | }], | ||||
"Optional<BlockArgument>", "getSuccessorBlockArgument", | "Optional<BlockArgument>", "getSuccessorBlockArgument", | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |