diff options
author | Edwin Török <edwintorok@gmail.com> | 2009-05-24 19:36:09 +0000 |
---|---|---|
committer | Edwin Török <edwintorok@gmail.com> | 2009-05-24 19:36:09 +0000 |
commit | f06a8f2744bb5981c1ec354931f3ab08503b5888 (patch) | |
tree | c22e6b09dd478719a963fdd87e626866a406adcc | |
parent | 53cc922be6318ac194d815b2e3cd14c0f5350294 (diff) | |
download | external_llvm-f06a8f2744bb5981c1ec354931f3ab08503b5888.zip external_llvm-f06a8f2744bb5981c1ec354931f3ab08503b5888.tar.gz external_llvm-f06a8f2744bb5981c1ec354931f3ab08503b5888.tar.bz2 |
Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.
Also fix 80 column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72371 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/ScalarEvolutionExpander.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 0340627..191fcc0 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -615,7 +615,8 @@ Value *SCEVExpander::expandCodeFor(SCEVHandle SH, const Type *Ty) { Value *SCEVExpander::expand(const SCEV *S) { // Check to see if we already expanded this. - std::map<SCEVHandle, AssertingVH<Value> >::iterator I = InsertedExpressions.find(S); + std::map<SCEVHandle, AssertingVH<Value> >::iterator I = + InsertedExpressions.find(S); if (I != InsertedExpressions.end()) return I->second; diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 07c7d00..f0f2d83 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -250,7 +250,8 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, // Iterate over all of the PHI nodes. BasicBlock::iterator BBI = ExitBB->begin(); while ((PN = dyn_cast<PHINode>(BBI++))) { - + if (PN->use_empty()) + continue; // dead use, don't replace it // Iterate over all of the values in all the PHI nodes. for (unsigned i = 0; i != NumPreds; ++i) { // If the value being merged in is not integer or is not defined @@ -303,7 +304,6 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, // in the loop, so we don't need an LCSSA phi node anymore. if (NumPreds == 1) { PN->replaceAllUsesWith(ExitVal); - Rewriter.clear(); RecursivelyDeleteTriviallyDeadInstructions(PN); break; } |