diff options
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index dd4e7e27a96..f94a65a75f0 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -699,10 +699,9 @@ Value *FAddCombine::createNaryFAdd bool LastValNeedNeg = false; // Iterate the addends, creating fadd/fsub using adjacent two addends. - for (AddendVect::const_iterator I = Opnds.begin(), E = Opnds.end(); - I != E; I++) { + for (const FAddend *Opnd : Opnds) { bool NeedNeg; - Value *V = createAddendVal(**I, NeedNeg); + Value *V = createAddendVal(*Opnd, NeedNeg); if (!LastVal) { LastVal = V; LastValNeedNeg = NeedNeg; @@ -791,9 +790,7 @@ unsigned FAddCombine::calcInstrNumber(const AddendVect &Opnds) { unsigned NegOpndNum = 0; // Adjust the number of instructions needed to emit the N-ary add. - for (AddendVect::const_iterator I = Opnds.begin(), E = Opnds.end(); - I != E; I++) { - const FAddend *Opnd = *I; + for (const FAddend *Opnd : Opnds) { if (Opnd->isConstant()) continue; |