[Mlir-commits] [mlir] [mlir][Interfaces][NFC] Better documentation for `RegionBranchOpInterface` (PR #66920)
Matthias Springer
llvmlistbot at llvm.org
Thu Sep 21 08:47:44 PDT 2023
================
@@ -147,32 +178,44 @@ def RegionBranchOpInterface : OpInterface<"RegionBranchOpInterface"> {
}]
>,
InterfaceMethod<[{
- Returns the viable region successors that are branched to when first
- executing the op.
+ Returns the potentional region successors when first executing the op.
+
Unlike `getSuccessorRegions`, this method also passes along the
- constant operands of this op. Based on these, different region
- successors can be determined.
- `operands` contains an entry for every operand of the implementing
- op with a null attribute if the operand has no constant value or
- the corresponding attribute if it is a constant.
+ constant operands of this op. Based on these, the implementation may
+ filter out certain successors. By default, simply dispatches to
+ `getSuccessorRegions`. `operands` contains an entry for every
+ operand of this op, with a null attribute if the operand has no constant
+ value.
- By default, simply dispatches to `getSuccessorRegions`.
+ Example: In the above example, this method may return two region
+ region successors: the single region of the `scf.for` op and the this
----------------
matthias-springer wrote:
Ah yes that's a typo, I meant "this operation", as in the `scf.for` op that implements the interface.
https://github.com/llvm/llvm-project/pull/66920
More information about the Mlir-commits
mailing list