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 | ef60b2c4ed67017a46442903c898bc24ed9a6c91 (patch) | |
tree | d46ac22ec1b955c9c286a893411d5d544011c678 | |
parent | 79cca507fe51aa8af7a9006b380977c61b6f3fea (diff) | |
download | external_llvm-ef60b2c4ed67017a46442903c898bc24ed9a6c91.zip external_llvm-ef60b2c4ed67017a46442903c898bc24ed9a6c91.tar.gz external_llvm-ef60b2c4ed67017a46442903c898bc24ed9a6c91.tar.bz2 |
simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33150 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 0643e75..5ef886e 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/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", |