Skip to content

Commit 7f7736a

Browse files
committed
Break out of loop early
1 parent 3266ee2 commit 7f7736a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/utils/TableGen/Common/CodeGenRegisters.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,18 @@ CodeGenRegister::computeSubRegs(CodeGenRegBank &RegBank) {
403403
continue;
404404

405405
// SR is composed of multiple sub-regs. Find their names in this register.
406+
bool AnyArtificial = false;
406407
SmallVector<CodeGenSubRegIndex *, 8> Parts;
407408
for (unsigned j = 0, e = SR->ExplicitSubRegs.size(); j != e; ++j) {
408409
CodeGenSubRegIndex &I = *SR->ExplicitSubRegIndices[j];
409-
if (!I.Artificial)
410-
Parts.push_back(getSubRegIndex(SR->ExplicitSubRegs[j]));
410+
if (I.Artificial) {
411+
AnyArtificial = true;
412+
break;
413+
}
414+
Parts.push_back(getSubRegIndex(SR->ExplicitSubRegs[j]));
411415
}
412416

413-
if (Parts.size() != SR->ExplicitSubRegs.size())
417+
if (AnyArtificial)
414418
continue;
415419

416420
// Offer this as an existing spelling for the concatenation of Parts.

0 commit comments

Comments
 (0)