From: Jim Grosbach Date: Thu, 19 Nov 2009 02:03:18 +0000 (+0000) Subject: Eliminate duplicate phi nodes in loops. Loop rotation, for example, can introduce... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d0b552cc5680ae245258598586115d05291b7b19;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 2ab09721495..44a2c1f8518 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; }