Enable loop bb placement optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71291 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2009-05-08 23:35:49 +00:00
parent b0285932ab
commit f045f80ba9
2 changed files with 1 additions and 10 deletions

View File

@ -19,17 +19,11 @@
#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;

View 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]