enable branch folding with an option
authorChris Lattner <sabre@nondot.org>
Wed, 1 Nov 2006 00:38:31 +0000 (00:38 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 1 Nov 2006 00:38:31 +0000 (00:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31335 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BranchFolding.cpp

index 9ca0091d20358226b4b1e0d3a883e45485f12705..11381466548fc501023a5be991197fa1589bd0b9 100644 (file)
@@ -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;