diff options
| author | Torok Edwin <edwintorok@gmail.com> | 2009-05-24 19:36:09 +0000 |
|---|---|---|
| committer | Torok Edwin <edwintorok@gmail.com> | 2009-05-24 19:36:09 +0000 |
| commit | 5349cf5f4b2a2d553658605171701c23a1193601 (patch) | |
| tree | 4e81704ce370e5ef57336d761a7ae43d960989dd /llvm/lib/Transforms | |
| parent | 2d49c4f98de60b11ff56a6ae6399162f1aaa2db8 (diff) | |
| download | bcm5719-llvm-5349cf5f4b2a2d553658605171701c23a1193601.tar.gz bcm5719-llvm-5349cf5f4b2a2d553658605171701c23a1193601.zip | |
Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.
Also fix 80 column violation.
llvm-svn: 72371
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 07c7d0071fb..f0f2d83b6e6 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/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; } |

