diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-05-13 21:42:09 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-05-13 21:42:09 +0000 |
commit | ab0d23396a79022051e5699ef26bd0367ce11a5d (patch) | |
tree | 7bf0924e0742a7ea2798b6a16326d22967be2dd7 /llvm/lib | |
parent | ffe4e63b408582f55b273224ba3a92309758ef6a (diff) | |
download | bcm5719-llvm-ab0d23396a79022051e5699ef26bd0367ce11a5d.tar.gz bcm5719-llvm-ab0d23396a79022051e5699ef26bd0367ce11a5d.zip |
Run code placement optimization for targets that want it (arm and x86 for now).
llvm-svn: 71726
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/CodePlacementOpt.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 1 |
4 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodePlacementOpt.cpp b/llvm/lib/CodeGen/CodePlacementOpt.cpp index 61a8b12860a..919ee54fb3f 100644 --- a/llvm/lib/CodeGen/CodePlacementOpt.cpp +++ b/llvm/lib/CodeGen/CodePlacementOpt.cpp @@ -104,6 +104,9 @@ FunctionPass *llvm::createCodePlacementOptPass() { /// jcc <cond> C, [exit] /// bool CodePlacementOpt::OptimizeIntraLoopEdges() { + if (!TLI->shouldOptimizeCodePlacement()) + return false; + bool Changed = false; for (unsigned i = 0, e = UncondJmpMBBs.size(); i != e; ++i) { MachineBasicBlock *MBB = UncondJmpMBBs[i].first; diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index d7abd32727b..1bb3959e68f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -483,6 +483,7 @@ TargetLowering::TargetLowering(TargetMachine &tm) memset(TargetDAGCombineArray, 0, array_lengthof(TargetDAGCombineArray)); maxStoresPerMemset = maxStoresPerMemcpy = maxStoresPerMemmove = 8; allowUnalignedMemoryAccesses = false; + benefitFromCodePlacementOpt = false; UseUnderscoreSetJmp = false; UseUnderscoreLongJmp = false; SelectIsExpensive = false; diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 48e197d04f6..f5b33b02cab 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -288,6 +288,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM) setIfCvtDupBlockSizeLimit(Subtarget->isThumb() ? 0 : 2); maxStoresPerMemcpy = 1; //// temporary - rewrite interface to use type + benefitFromCodePlacementOpt = true; } const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const { diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 9ac59df5bd9..debfac48671 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -844,6 +844,7 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM) maxStoresPerMemmove = 3; // For @llvm.memmove -> sequence of stores allowUnalignedMemoryAccesses = true; // x86 supports it! setPrefLoopAlignment(16); + benefitFromCodePlacementOpt = true; } |