summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-10-29 21:05:17 +0000
committerOwen Anderson <resistor@mac.com>2010-10-29 21:05:17 +0000
commit374e1464ae7a35df8efac9c73ef3f6324f81dad1 (patch)
treeb2b14faac867ad5d0dc53ddfa05cfddd2d6906a1 /llvm/lib/Transforms
parent72dfc6a7c7a448b5c5b29ec4bf5f5849c5fdafb8 (diff)
downloadbcm5719-llvm-374e1464ae7a35df8efac9c73ef3f6324f81dad1.tar.gz
bcm5719-llvm-374e1464ae7a35df8efac9c73ef3f6324f81dad1.zip
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. llvm-svn: 117709
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
index 0f8f6d28e4f..44e72e2232c 100644
--- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
+++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
@@ -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 CorrelatedValuePropagation::runOnFunction(Function &F) {
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 @@ bool CorrelatedValuePropagation::runOnFunction(Function &F) {
}
}
- // Propagating correlated values might leave cruft around.
- // Try to clean it up before we continue.
- if (BBChanged)
- SimplifyInstructionsInBlock(*FI);
-
FnChanged |= BBChanged;
}
OpenPOWER on IntegriCloud