aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-08-06 01:32:48 +0000
committerBill Wendling <isanbard@gmail.com>2010-08-06 01:32:48 +0000
commit49fbac55a4aceae06fdfad7d5e24c513363c7cf8 (patch)
tree6f2a410521d3378fe204476415e5ba036c7ed9dc /lib/CodeGen/LLVMTargetMachine.cpp
parent951f496d370ea73df169637a16a33c8cc7d1130c (diff)
downloadexternal_llvm-49fbac55a4aceae06fdfad7d5e24c513363c7cf8.zip
external_llvm-49fbac55a4aceae06fdfad7d5e24c513363c7cf8.tar.gz
external_llvm-49fbac55a4aceae06fdfad7d5e24c513363c7cf8.tar.bz2
Add the Optimize Compares pass (disabled by default).
This pass tries to remove comparison instructions when possible. For instance, if you have this code: sub r1, 1 cmp r1, 0 bz L1 and "sub" either sets the same flag as the "cmp" instruction or could be converted to set the same flag, then we can eliminate the "cmp" instruction all together. This is a important for ARM where the ALU instructions could set the CPSR flag, but need a special suffix ('s') to do so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 36c837d..5b2d40b 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -354,6 +354,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
printAndVerify(PM, "After codegen DCE pass");
PM.add(createOptimizeExtsPass());
+ PM.add(createOptimizeCmpsPass());
if (!DisableMachineLICM)
PM.add(createMachineLICMPass());
PM.add(createMachineCSEPass());