aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-10 07:51:31 +0000
committerChris Lattner <sabre@nondot.org>2011-01-10 07:51:31 +0000
commit6c8b8dd5228a17ecc12fd61d58578f5186b07e74 (patch)
treeffb4792f0ae9e7f5250d07eec808675423fc9d38 /llvm/lib/CodeGen/MachineCSE.cpp
parenta8bac7f514ae46a7d4b26d05762ee799b78462ac (diff)
downloadllvm-6c8b8dd5228a17ecc12fd61d58578f5186b07e74.zip
llvm-6c8b8dd5228a17ecc12fd61d58578f5186b07e74.tar.gz
llvm-6c8b8dd5228a17ecc12fd61d58578f5186b07e74.tar.bz2
fit in 80 cols and use MBB::isSuccessor instead of a hand
rolled std::find. llvm-svn: 123164
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index 60ad46a..07a7d27 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -284,14 +284,13 @@ bool MachineCSE::isProfitableToCSE(unsigned CSReg, unsigned Reg,
MachineInstr *CSMI, MachineInstr *MI) {
// FIXME: Heuristics that works around the lack the live range splitting.
- // Heuristics #1: Don't cse "cheap" computating if the def is not local or in an
- // immediate predecessor. We don't want to increase register pressure and end up
- // causing other computation to be spilled.
+ // Heuristics #1: Don't CSE "cheap" computation if the def is not local or in
+ // an immediate predecessor. We don't want to increase register pressure and
+ // end up causing other computation to be spilled.
if (MI->getDesc().isAsCheapAsAMove()) {
MachineBasicBlock *CSBB = CSMI->getParent();
MachineBasicBlock *BB = MI->getParent();
- if (CSBB != BB &&
- find(CSBB->succ_begin(), CSBB->succ_end(), BB) == CSBB->succ_end())
+ if (CSBB != BB && !CSBB->isSuccessor(BB))
return false;
}