Skip to content

Commit e78eef2

Browse files
[X86] Use hasSingleElement (NFC) (#133040)
1 parent a1a74c9 commit e78eef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/X86/X86CmovConversion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ bool X86CmovConverterPass::checkForProfitableCmovCandidates(
555555
// This is another conservative check to avoid converting CMOV instruction
556556
// used with tree-search like algorithm, where the branch is unpredicted.
557557
auto UIs = MRI->use_instructions(MI->defs().begin()->getReg());
558-
if (!UIs.empty() && ++UIs.begin() == UIs.end()) {
558+
if (hasSingleElement(UIs)) {
559559
unsigned Op = UIs.begin()->getOpcode();
560560
if (Op == X86::MOV64rm || Op == X86::MOV32rm) {
561561
WorthOpGroup = false;

0 commit comments

Comments
 (0)