[llvm-branch-commits] [mlir] [mlir][draft] Consolidate patterns into `RegionBranchOpInterface` patterns (PR #174094)
Ivan Butygin via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 1 05:21:37 PST 2026
================
@@ -521,6 +523,45 @@ void RegionBranchOpInterface::getSuccessorOperandInputMapping(
}
}
+void RegionBranchOpInterface::getSuccessorInputOperandMapping(
+ RegionBranchInverseSuccessorMapping &mapping) {
+ RegionBranchSuccessorMapping operandToInputs;
+ getSuccessorOperandInputMapping(operandToInputs);
+ for (const auto &[operand, inputs] : operandToInputs) {
+ for (Value input : inputs)
+ mapping[input].push_back(operand);
+ }
+}
+
+DenseSet<Value>
+RegionBranchOpInterface::computePossibleValuesOfSuccessorInput(Value value) {
+ RegionBranchInverseSuccessorMapping inputToOperands;
+ getSuccessorInputOperandMapping(inputToOperands);
+
+ DenseSet<Value> possibleValues;
+ DenseSet<Value> visited;
----------------
Hardcode84 wrote:
`SmallDenseSet`s?
https://github.com/llvm/llvm-project/pull/174094
More information about the llvm-branch-commits
mailing list