aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-19 09:08:34 +0000
committerChris Lattner <sabre@nondot.org>2003-12-19 09:08:34 +0000
commitbd1a90ecc77cfdf25125c96acaad1b4152fcd0de (patch)
treeeb4bb28294743412b25eb51602c3422261c527da /lib/Transforms/Scalar
parent7fe178681bdf93399861382df4f68c78fce24d92 (diff)
downloadexternal_llvm-bd1a90ecc77cfdf25125c96acaad1b4152fcd0de.zip
external_llvm-bd1a90ecc77cfdf25125c96acaad1b4152fcd0de.tar.gz
external_llvm-bd1a90ecc77cfdf25125c96acaad1b4152fcd0de.tar.bz2
Fix ADCE/2003-12-19-MergeReturn.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index a06e746..32caaf1 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -14,21 +14,21 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Type.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/iTerminators.h"
#include "llvm/iPHINode.h"
#include "llvm/Constant.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Transforms/Utils/BasicBlockUtils.h"
+#include "llvm/Transforms/Utils/Local.h"
+#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "Support/Debug.h"
#include "Support/DepthFirstIterator.h"
#include "Support/Statistic.h"
#include "Support/STLExtras.h"
#include <algorithm>
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed");
@@ -61,6 +61,9 @@ public:
// getAnalysisUsage - We require post dominance frontiers (aka Control
// Dependence Graph)
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ // We require that all function nodes are unified, because otherwise code
+ // can be marked live that wouldn't necessarily be otherwise.
+ AU.addRequired<UnifyFunctionExitNodes>();
AU.addRequired<PostDominatorTree>();
AU.addRequired<PostDominanceFrontier>();
}
@@ -101,7 +104,7 @@ private:
RegisterOpt<ADCE> X("adce", "Aggressive Dead Code Elimination");
} // End of anonymous namespace
-Pass *createAggressiveDCEPass() { return new ADCE(); }
+Pass *llvm::createAggressiveDCEPass() { return new ADCE(); }
void ADCE::markBlockAlive(BasicBlock *BB) {
// Mark the basic block as being newly ALIVE... and mark all branches that
@@ -474,5 +477,3 @@ bool ADCE::doADCE() {
return MadeChanges;
}
-
-} // End llvm namespace