[Mlir-commits] [mlir] [MLIR][SCF] Speed up ConditionPropagation (PR #166080)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Nov 3 01:05:21 PST 2025


================
@@ -2565,6 +2565,38 @@ struct ConvertTrivialIfToSelect : public OpRewritePattern<IfOp> {
 struct ConditionPropagation : public OpRewritePattern<IfOp> {
   using OpRewritePattern<IfOp>::OpRewritePattern;
 
+  enum class Parent { Then, Else, None };
+
+  static Parent getParentType(Region *toCheck, IfOp op,
----------------
ftynse wrote:

```suggestion
  /// Returns the kind of region ("then", "else", or "none") of the
  /// IfOp that the given region is transitively nested in. Updates
  /// the cache accordingly.
  static Parent getParentType(Region *toCheck, IfOp op,
```

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


More information about the Mlir-commits mailing list