aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 1fb37fb..ec5b757 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -7382,12 +7382,9 @@ bool CodeGenPrepare::tryToSinkFreeOperands(Instruction *I) {
if (IsHugeFunc) {
// Now we clone an instruction, its operands' defs may sink to this BB
// now. So we put the operands defs' BBs into FreshBBs to do optimization.
- for (unsigned I = 0; I < NI->getNumOperands(); ++I) {
- auto *OpDef = dyn_cast<Instruction>(NI->getOperand(I));
- if (!OpDef)
- continue;
- FreshBBs.insert(OpDef->getParent());
- }
+ for (Value *Op : NI->operands())
+ if (auto *OpDef = dyn_cast<Instruction>(Op))
+ FreshBBs.insert(OpDef->getParent());
}
NewInstructions[UI] = NI;