[Mlir-commits] [mlir] [mlir] Fix RemoveDeadRegionBranchOpSuccessorInputs producing invalid scf.for (LoopLikeOpInterface tie) (PR #216627)
Matthias Springer
llvmlistbot at llvm.org
Sun Aug 16 23:53:45 PDT 2026
================
@@ -330,11 +330,26 @@ Region *getEnclosingRepetitiveRegion(Operation *op);
/// exists.
Region *getEnclosingRepetitiveRegion(Value value);
+/// Callback that reports pairs of successor-input values (e.g. a region
+/// iter_arg and its corresponding op result) that are structurally coupled and
+/// must be added or removed together, even if they are not linked through a
+/// shared successor operand in `getSuccessorOperandInputMapping`. This is
+/// needed when `getSuccessorRegions` refines the control-flow graph and drops
+/// an edge that would otherwise tie them (e.g. a statically-single-trip
+/// `scf.for` drops its region->region back edge, so its iter_args and results
+/// are no longer tied through the yield operand). Each reported pair is unioned
+/// into the set of tied successor inputs. Loop-like ops can implement this
+/// using `getRegionIterArgs()` / `getLoopResults()`.
+using RegionBranchStructuralTieFn = std::function<void(
+ Operation *, SmallVectorImpl<std::pair<Value, Value>> &)>;
----------------
matthias-springer wrote:
Can the signature be generalized to the case where more than 2 SSA values are tied?
https://github.com/llvm/llvm-project/pull/216627
More information about the Mlir-commits
mailing list