[Mlir-commits] [clang] [flang] [mlir] [mlir][Interfaces] Single interface method to query constant region-based CF (PR #193486)
Matthias Springer
llvmlistbot at llvm.org
Wed Apr 22 06:18:46 PDT 2026
================
@@ -137,6 +137,13 @@ def RegionBranchOpInterface : OpInterface<"RegionBranchOpInterface"> {
specified with `getEntrySuccessorOperands` /
`RegionBranchTerminatorOpInterface::getSuccessorOperands`.
+ Implementations may also optionally refine the set of successors based on
+ constant operand values. To do so, implement
+ `getSuccessorRegionsWithConstants`, which that takes a
+ `RegionBranchPointOperandConstants` argument; that method is invoked by
+ analyses that have constant-folded information. By default, the
+ constants-aware overload dispatches to the no-constants overload.
----------------
matthias-springer wrote:
The contract hasn't changed. `getSuccessorRegionsWithConstants` corresponds to `getEntrySuccessorRegions`. I just couldn't use the word "entry" anymore.
However, the contract is unclear. Before this PR and after the PR. I'm not trying to fix that here.
This PR was meant as a small standalone improvement irrespective of the structural/reachable CF discussion. (I attached a link to that RFC, but it points to reply number 16.) The concrete problem that this PR addresses: Make clear in the API design that you don't have to use `RegionBranchTerminatorOpInterface::getSuccessorRegions` to query CF edges.
https://github.com/llvm/llvm-project/pull/193486
More information about the Mlir-commits
mailing list