Enable loop bb placement optimization.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 8 May 2009 23:35:49 +0000 (23:35 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 8 May 2009 23:35:49 +0000 (23:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71291 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodePlacementOpt.cpp
test/CodeGen/X86/code_placement.ll

index 1848378e06dfbbb92967d60313dd526396dc7002..32399bff95f87614d6f7f71f3b46656d128a99fb 100644 (file)
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
-static cl::opt<bool>
-OptLoopBBPlacement("opt-loop-bb-placement",
-                   cl::init(false), cl::Hidden,
-                   cl::desc("Optimize block placements in loops"));
-
 STATISTIC(NumHeaderAligned, "Number of loop header aligned");
 STATISTIC(NumIntraElim,     "Number of intra loop branches eliminated");
 STATISTIC(NumIntraMoved,    "Number of intra loop branches moved");
@@ -108,9 +102,6 @@ FunctionPass *llvm::createCodePlacementOptPass() {
 ///       jcc <cond> C, [exit]
 ///
 bool CodePlacementOpt::OptimizeIntraLoopEdges() {
-  if (!OptLoopBBPlacement)
-    return false;
-
   bool Changed = false;
   for (unsigned i = 0, e = UncondJmpMBBs.size(); i != e; ++i) {
     MachineBasicBlock *MBB = UncondJmpMBBs[i].first;
index 3ffb6ba3d82395c39250b1a613999c7eb0329cc2..55167950d1a0129228173ce4af5b45667fde6779 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -opt-loop-bb-placement | %prcontext jmp 1 | grep align
+; RUN: llvm-as < %s | llc -march=x86 | %prcontext jmp 1 | grep align
 
 @Te0 = external global [256 x i32]             ; <[256 x i32]*> [#uses=5]
 @Te1 = external global [256 x i32]             ; <[256 x i32]*> [#uses=4]