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