[Mlir-commits] [mlir] [mlir][SCF] Report error when lowering to cf in single block op (PR #65305)

Mehdi Amini llvmlistbot at llvm.org
Tue Sep 5 13:21:36 PDT 2023


================
@@ -370,6 +373,9 @@ LogicalResult ForLowering::matchAndRewrite(ForOp forOp,
 LogicalResult IfLowering::matchAndRewrite(IfOp ifOp,
                                           PatternRewriter &rewriter) const {
   auto loc = ifOp.getLoc();
+  if (ifOp->getParentOp()->hasTrait<OpTrait::SingleBlock>())
+    return ifOp->emitError(
+        "cannot lower op inside parent that expects a single block");
----------------
joker-eph wrote:

Please use `notifyMatchFailure` instead

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


More information about the Mlir-commits mailing list