File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
clang/lib/CIR/Lowering/DirectToLLVM Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ class CIRLoopOpLowering : public mlir::OpConversionPattern<mlir::cir::LoopOp> {
126126 return mlir::failure ();
127127 }
128128 }
129+
130+ // Succeed only if both yields are found.
131+ if (!yieldToBody || !yieldToCont)
132+ return mlir::failure ();
129133 return mlir::success ();
130134 }
131135
@@ -142,7 +146,7 @@ class CIRLoopOpLowering : public mlir::OpConversionPattern<mlir::cir::LoopOp> {
142146 auto &condFrontBlock = condRegion.front ();
143147 mlir::cir::YieldOp yieldToBody, yieldToCont;
144148 if (fetchCondRegionYields (condRegion, yieldToBody, yieldToCont).failed ())
145- loopOp.emitError (" invalid yield op kind in cond region" );
149+ return loopOp.emitError (" failed to fetch yields in cond region" );
146150
147151 // Fetch required info from the condition region.
148152 auto &bodyRegion = loopOp.getBody ();
You can’t perform that action at this time.
0 commit comments