summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit7de9d52c139e43469f1e07bb204c2da613fb18bb (patch)
tree7f33694bf3ee29fc7faff2e099a85c43dbb3a930 /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parent957fc3df529b108b24548a60cf702f42b78a799c (diff)
downloadbcm5719-llvm-7de9d52c139e43469f1e07bb204c2da613fb18bb.tar.gz
bcm5719-llvm-7de9d52c139e43469f1e07bb204c2da613fb18bb.zip
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. llvm-svn: 110423
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 36c837d59fe..5b2d40b5857 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud