We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 616a8ce commit c02fd17Copy full SHA for c02fd17
mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
@@ -482,7 +482,10 @@ LogicalResult
482
ParallelLowering::matchAndRewrite(ParallelOp parallelOp,
483
PatternRewriter &rewriter) const {
484
Location loc = parallelOp.getLoc();
485
- auto reductionOp = cast<ReduceOp>(parallelOp.getBody()->getTerminator());
+ auto reductionOp = dyn_cast<ReduceOp>(parallelOp.getBody()->getTerminator());
486
+ if (!reductionOp) {
487
+ return failure();
488
+ }
489
490
// For a parallel loop, we essentially need to create an n-dimensional loop
491
// nest. We do this by translating to scf.for ops and have those lowered in
0 commit comments