Skip to content

Commit 1c8647a

Browse files
[mlir] Use llvm::hasSingleElement (NFC) (#133648)
1 parent 8a8c89a commit 1c8647a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mlir/lib/Dialect/SPIRV/IR/ControlFlowOps.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@ static bool hasOneBranchOpTo(Block &srcBlock, Block &dstBlock) {
255255

256256
/// Returns true if the given `block` only contains one `spirv.mlir.merge` op.
257257
static bool isMergeBlock(Block &block) {
258-
return !block.empty() && std::next(block.begin()) == block.end() &&
259-
isa<spirv::MergeOp>(block.front());
258+
return llvm::hasSingleElement(block) && isa<spirv::MergeOp>(block.front());
260259
}
261260

262261
/// Returns true if a `spirv.mlir.merge` op outside the merge block.

0 commit comments

Comments
 (0)