simplify some code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33150 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-01-12 22:51:20 +00:00
parent 79cca507fe
commit ef60b2c4ed

View File

@ -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",