[llvm-commits] [llvm] r117709 - /llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

Owen Anderson resistor at me.com
Fri Oct 29 14:10:57 PDT 2010


Unfortunately, the testcase I have for this is sensitive to iteration orders and doesn't reproduce in isolation.

--Owen

On Oct 29, 2010, at 2:05 PM, Owen Anderson wrote:

> Author: resistor
> Date: Fri Oct 29 16:05:17 2010
> New Revision: 117709
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=117709&view=rev
> Log:
> Give up on doing in-line instruction simplification during correlated value propagation.  Instruction simplification
> needs to be guaranteed never to be run on an unreachable block.  However, earlier block simplifications may have
> changed the CFG to make block that were reachable when we began our iteration unreachable by the time we try to
> simplify them. (Note that this also means that our depth-first iterators were potentially being invalidated).
> 
> This should not have a large impact on code quality, since later runs of instcombine should pick up these simplifications.
> Fixes PR8506.
> 
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
> 
> Modified: llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp?rev=117709&r1=117708&r2=117709&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp Fri Oct 29 16:05:17 2010
> @@ -19,7 +19,6 @@
> #include "llvm/Analysis/LazyValueInfo.h"
> #include "llvm/Support/CFG.h"
> #include "llvm/Transforms/Utils/Local.h"
> -#include "llvm/ADT/DepthFirstIterator.h"
> #include "llvm/ADT/Statistic.h"
> using namespace llvm;
> 
> @@ -172,10 +171,7 @@
> 
>   bool FnChanged = false;
> 
> -  // Perform a depth-first walk of the CFG so that we don't waste time
> -  // optimizing unreachable blocks.
> -  for (df_iterator<BasicBlock*> FI = df_begin(&F.getEntryBlock()),
> -       FE = df_end(&F.getEntryBlock()); FI != FE; ++FI) {
> +  for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
>     bool BBChanged = false;
>     for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ) {
>       Instruction *II = BI++;
> @@ -197,11 +193,6 @@
>       }
>     }
> 
> -    // Propagating correlated values might leave cruft around.
> -    // Try to clean it up before we continue.
> -    if (BBChanged)
> -      SimplifyInstructionsInBlock(*FI);
> -    
>     FnChanged |= BBChanged;
>   }
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101029/bfda17a3/attachment.html>


More information about the llvm-commits mailing list