aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-09-23 06:55:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-09-23 06:55:34 +0000
commitdd3a41a6b35f24d57fd3aba9043bd5321cce0cdb (patch)
tree1e4f45201128bd530872c474dc800e6f8f8a04e5 /lib/Transforms/Scalar/CodeGenPrepare.cpp
parent108c8724663354050dc09bb1262c3e4511adf82f (diff)
Disable codegen prepare critical edge splitting. Machine instruction passes now
break critical edges on demand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114633 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 3221e14347..880a4e5eb8 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -31,6 +31,7 @@
#include "llvm/Transforms/Utils/BuildLibCalls.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/CommandLine.h"
@@ -42,10 +43,12 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+STATISTIC(NumElim, "Number of blocks eliminated");
+
static cl::opt<bool>
CriticalEdgeSplit("cgp-critical-edge-splitting",
cl::desc("Split critical edges during codegen prepare"),
- cl::init(true), cl::Hidden);
+ cl::init(false), cl::Hidden);
namespace {
class CodeGenPrepare : public FunctionPass {
@@ -302,6 +305,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
PFI->removeEdge(ProfileInfo::getEdge(BB, DestBB));
}
BB->eraseFromParent();
+ ++NumElim;
DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n");
}