mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 16:56:35 +00:00
[mlir] Use llvm::hasSingleElement (NFC) (#133881)
This commit is contained in:
parent
19a319667b
commit
1d9ad99305
@ -119,7 +119,7 @@ bool Block::verifyOpOrder() {
|
||||
if (!isOpOrderValid())
|
||||
return false;
|
||||
// The order is valid if there are less than 2 operations.
|
||||
if (operations.empty() || std::next(operations.begin()) == operations.end())
|
||||
if (operations.empty() || llvm::hasSingleElement(operations))
|
||||
return false;
|
||||
|
||||
Operation *prev = nullptr;
|
||||
|
@ -330,7 +330,7 @@ inlineRegionImpl(InlinerInterface &interface, Region *src, Block *inlineBlock,
|
||||
bool singleBlockFastPath = interface.allowSingleBlockOptimization(newBlocks);
|
||||
|
||||
// Handle the case where only a single block was inlined.
|
||||
if (singleBlockFastPath && std::next(newBlocks.begin()) == newBlocks.end()) {
|
||||
if (singleBlockFastPath && llvm::hasSingleElement(newBlocks)) {
|
||||
// Run the result attribute handler on the terminator operands.
|
||||
Operation *firstBlockTerminator = firstNewBlock->getTerminator();
|
||||
builder.setInsertionPoint(firstBlockTerminator);
|
||||
|
Loading…
x
Reference in New Issue
Block a user