summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-01 00:38:31 +0000
committerChris Lattner <sabre@nondot.org>2006-11-01 00:38:31 +0000
commit3ac71b31f0a30698de69752cd1c5dd7f70e09811 (patch)
treeb4e138450ef3ef481e323f229c50eaf8ddb005f4 /llvm/lib/CodeGen
parent23654935f42ac1200528a2f5f2574452c3e093ca (diff)
downloadbcm5719-llvm-3ac71b31f0a30698de69752cd1c5dd7f70e09811.tar.gz
bcm5719-llvm-3ac71b31f0a30698de69752cd1c5dd7f70e09811.zip
enable branch folding with an option
llvm-svn: 31335
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 9ca0091d203..11381466548 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -30,6 +30,7 @@ using namespace llvm;
static Statistic<> NumDeadBlocks("branchfold", "Number of dead blocks removed");
static Statistic<> NumBranchOpts("branchfold", "Number of branches optimized");
static Statistic<> NumTailMerge ("branchfold", "Number of block tails merged");
+static cl::opt<bool> EnableTailMerge("enable-tail-merge", cl::Hidden);
namespace {
struct BranchFolder : public MachineFunctionPass {
@@ -258,7 +259,7 @@ void BranchFolder::ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
bool BranchFolder::TailMergeBlocks(MachineFunction &MF) {
MadeChange = false;
- return false;
+ if (!EnableTailMerge) return false;
// Find blocks with no successors.
std::vector<std::pair<unsigned,MachineBasicBlock*> > MergePotentials;
OpenPOWER on IntegriCloud