[flang-commits] [clang] [flang] [mlir] [mlir][Interfaces] Single interface method to query constant region-based CF (PR #193486)

Mehdi Amini via flang-commits flang-commits at lists.llvm.org
Wed Apr 22 05:32:02 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.
----------------
joker-eph wrote:

Somehow NFC, but now we have `getSuccessorRegions()` and `getSuccessorRegionsWithConstants()` with unclear overlapping contract. I'd like to see the complete stack of PRs to get better agreement on the end state. 
The "problem" that needs fixing here should be better stated, because while the interface is imperfect, we may be bundling quite a few things together to serve different purposes.

https://github.com/llvm/llvm-project/pull/193486


More information about the flang-commits mailing list