diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp index 0f8f6d28e4f7..44e72e2232c2 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 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; }