diff options
| author | Jim Grosbach <grosbach@apple.com> | 2009-11-19 02:03:18 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2009-11-19 02:03:18 +0000 |
| commit | a6b28c2ca5ac9fa8b911e5b68fe07ee47bf054ce (patch) | |
| tree | 9a7559743f74038d48d4d68fb1ea873d6d67ce18 | |
| parent | ba8e8e58a471dd3252b5f7e3da42501e2508f17f (diff) | |
| download | external_llvm-a6b28c2ca5ac9fa8b911e5b68fe07ee47bf054ce.zip external_llvm-a6b28c2ca5ac9fa8b911e5b68fe07ee47bf054ce.tar.gz external_llvm-a6b28c2ca5ac9fa8b911e5b68fe07ee47bf054ce.tar.bz2 | |
Eliminate duplicate phi nodes in loops. Loop rotation, for example, can introduce these, and it's beneficial to later passes to clean them up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89298 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 2ab0972..44a2c1f 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -305,6 +305,12 @@ ReprocessLoop: } } + // If there are duplicate phi nodes (for example, from loop rotation), + // get rid of them. + for (Loop::block_iterator BB = L->block_begin(), E = L->block_end(); + BB != E; ++BB) + EliminateDuplicatePHINodes(*BB); + return Changed; } |
