1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00

[InstCombine] Use range-based for loop. NFC

llvm-svn: 298680
This commit is contained in:
Craig Topper 2017-03-24 02:58:02 +00:00
parent a73d121358
commit e6620030f6

View File

@ -3019,12 +3019,11 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB, const DataLayout &DL,
}
// See if we can constant fold its operands.
for (User::op_iterator i = Inst->op_begin(), e = Inst->op_end(); i != e;
++i) {
if (!isa<ConstantVector>(i) && !isa<ConstantExpr>(i))
for (Use &U : Inst->operands()) {
if (!isa<ConstantVector>(U) && !isa<ConstantExpr>(U))
continue;
auto *C = cast<Constant>(i);
auto *C = cast<Constant>(U);
Constant *&FoldRes = FoldedConstants[C];
if (!FoldRes)
FoldRes = ConstantFoldConstant(C, DL, TLI);
@ -3035,7 +3034,7 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB, const DataLayout &DL,
DEBUG(dbgs() << "IC: ConstFold operand of: " << *Inst
<< "\n Old = " << *C
<< "\n New = " << *FoldRes << '\n');
*i = FoldRes;
U = FoldRes;
MadeIRChange = true;
}
}