diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-10 07:51:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-10 07:51:31 +0000 |
commit | 622a11bc0764897f6aaf80fe96b3abac6215f06b (patch) | |
tree | ea7ed4561ebfb1f6956b8e3b450e40ea042c58f5 /lib/CodeGen/MachineCSE.cpp | |
parent | 9cc9f50abc28f08fb6082b5ee4f5cc7e1af4969b (diff) |
fit in 80 cols and use MBB::isSuccessor instead of a hand
rolled std::find.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | lib/CodeGen/MachineCSE.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/MachineCSE.cpp b/lib/CodeGen/MachineCSE.cpp index 60ad46a0d3..07a7d27b01 100644 --- a/lib/CodeGen/MachineCSE.cpp +++ b/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; } |