Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mlir/lib/Dialect/SPIRV/IR/ControlFlowOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ LogicalResult LoopOp::verifyRegions() {
return emitOpError(
"should not have 'spirv.mlir.merge' op outside the merge block");

if (std::next(region.begin()) == region.end())
if (region.hasOneBlock())
return emitOpError(
"must have an entry block branching to the loop header block");
// The first block is the entry block.
Expand Down Expand Up @@ -502,7 +502,7 @@ LogicalResult SelectionOp::verifyRegions() {
return emitOpError(
"should not have 'spirv.mlir.merge' op outside the merge block");

if (std::next(region.begin()) == region.end())
if (region.hasOneBlock())
return emitOpError("must have a selection header block");

return success();
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Transforms/Utils/RegionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ LogicalResult mlir::eraseUnreachableBlocks(RewriterBase &rewriter,
continue;

// If this is a single block region, just collect the nested regions.
if (std::next(region->begin()) == region->end()) {
if (region->hasOneBlock()) {
for (Operation &op : region->front())
for (Region &region : op.getRegions())
worklist.push_back(&region);
Expand Down
Loading