aboutsummaryrefslogtreecommitdiffstats
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
commitd8ccff0c3e5028019a02dd44bf7d906efc9effd8 (patch)
treece34b531c9f45f3473078265666b1eae8bee6482
parent0db427bb2d06950750faac4dc0440493dca5ff78 (diff)
downloadexternal_llvm-d8ccff0c3e5028019a02dd44bf7d906efc9effd8.zip
external_llvm-d8ccff0c3e5028019a02dd44bf7d906efc9effd8.tar.gz
external_llvm-d8ccff0c3e5028019a02dd44bf7d906efc9effd8.tar.bz2
enable branch folding with an option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31335 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/BranchFolding.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 9ca0091..1138146 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/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;