Skip to content

Commit dfa13c0

Browse files
[CodeGen] Use a range-based for loop (NFC) (#104408)
1 parent 224b280 commit dfa13c0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7382,12 +7382,9 @@ bool CodeGenPrepare::tryToSinkFreeOperands(Instruction *I) {
73827382
if (IsHugeFunc) {
73837383
// Now we clone an instruction, its operands' defs may sink to this BB
73847384
// now. So we put the operands defs' BBs into FreshBBs to do optimization.
7385-
for (unsigned I = 0; I < NI->getNumOperands(); ++I) {
7386-
auto *OpDef = dyn_cast<Instruction>(NI->getOperand(I));
7387-
if (!OpDef)
7388-
continue;
7389-
FreshBBs.insert(OpDef->getParent());
7390-
}
7385+
for (Value *Op : NI->operands())
7386+
if (auto *OpDef = dyn_cast<Instruction>(Op))
7387+
FreshBBs.insert(OpDef->getParent());
73917388
}
73927389

73937390
NewInstructions[UI] = NI;

0 commit comments

Comments
 (0)