diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-12 22:51:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-12 22:51:20 +0000 |
commit | f5e5236b572cbf8c5438ba0fa02aeb90cf8b3ae0 (patch) | |
tree | 0b4dbcebf4ac34f2661a256aa2148ffc7353cf5b /llvm/lib | |
parent | 61a4be88b4212aa3e39163de3dd045abcf378bdb (diff) | |
download | bcm5719-llvm-f5e5236b572cbf8c5438ba0fa02aeb90cf8b3ae0.tar.gz bcm5719-llvm-f5e5236b572cbf8c5438ba0fa02aeb90cf8b3ae0.zip |
simplify some code
llvm-svn: 33150
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 0643e75ab34..5ef886e956c 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -533,14 +533,8 @@ void IndVarSimplify::runOnLoop(Loop *L) { InsertedSizes.push_back(LargestType->getPrimitiveSizeInBits()); for (unsigned i = 0, e = IndVars.size(); i != e; ++i) { unsigned ithSize = IndVars[i].first->getType()->getPrimitiveSizeInBits(); - bool alreadyInsertedSize = false; - for (SmallVector<unsigned,4>::iterator I = InsertedSizes.begin(), - E = InsertedSizes.end(); I != E; ++I) - if (*I == ithSize) { - alreadyInsertedSize = true; - break; - } - if (!alreadyInsertedSize) { + if (std::find(InsertedSizes.begin(), InsertedSizes.end(), ithSize) + == InsertedSizes.end()) { PHINode *PN = IndVars[i].first; InsertedSizes.push_back(ithSize); Instruction *New = new TruncInst(IndVar, PN->getType(), "indvar", |