Use A.append(...) instead of A.insert(A.end(), ...) when A is a

SmallVector, and other SmallVector simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106452 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-06-21 19:47:52 +00:00
parent 658ebcc7ec
commit 403a8cdda5
9 changed files with 26 additions and 29 deletions

View File

@@ -288,11 +288,11 @@ static void SimplifyAddOperands(SmallVectorImpl<const SCEV *> &Ops,
// the sum into a single value, so just use that.
Ops.clear();
if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Sum))
Ops.insert(Ops.end(), Add->op_begin(), Add->op_end());
Ops.append(Add->op_begin(), Add->op_end());
else if (!Sum->isZero())
Ops.push_back(Sum);
// Then append the addrecs.
Ops.insert(Ops.end(), AddRecs.begin(), AddRecs.end());
Ops.append(AddRecs.begin(), AddRecs.end());
}
/// SplitAddRecs - Flatten a list of add operands, moving addrec start values
@@ -315,7 +315,7 @@ static void SplitAddRecs(SmallVectorImpl<const SCEV *> &Ops,
A->getLoop()));
if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Start)) {
Ops[i] = Zero;
Ops.insert(Ops.end(), Add->op_begin(), Add->op_end());
Ops.append(Add->op_begin(), Add->op_end());
e += Add->getNumOperands();
} else {
Ops[i] = Start;
@@ -323,7 +323,7 @@ static void SplitAddRecs(SmallVectorImpl<const SCEV *> &Ops,
}
if (!AddRecs.empty()) {
// Add the addrecs onto the end of the list.
Ops.insert(Ops.end(), AddRecs.begin(), AddRecs.end());
Ops.append(AddRecs.begin(), AddRecs.end());
// Resort the operand list, moving any constants to the front.
SimplifyAddOperands(Ops, Ty, SE);
}