aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-16 01:00:07 +0000
committerChris Lattner <sabre@nondot.org>2006-11-16 01:00:07 +0000
commite01eaa09c6be30497fde9bc4a8776752f27f74b6 (patch)
tree64186910eca7a047b89b06c0d58719c4da183c7d /lib/CodeGen/LLVMTargetMachine.cpp
parent80df01d2cf68b680b1c90eb0d3b0f2defcdf202b (diff)
enable the branch folding pass for the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index ae13625c20..f113b16f26 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -147,6 +147,9 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM,
if (PrintMachineCode) // Print the register-allocated code
PM.add(createMachineFunctionPrinterPass(&std::cerr));
+ // Branch folding must be run after regalloc and prolog/epilog insertion.
+ if (!Fast)
+ PM.add(createBranchFoldingPass());
if (addPreEmitPass(PM, Fast) && PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(&std::cerr));