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
This commit is contained in:
Chris Lattner 2011-01-10 07:51:31 +00:00
parent 9cc9f50abc
commit 622a11bc07

View File

@ -284,14 +284,13 @@ bool MachineCSE::isProfitableToCSE(unsigned CSReg, unsigned Reg,
MachineInstr *CSMI, MachineInstr *MI) { MachineInstr *CSMI, MachineInstr *MI) {
// FIXME: Heuristics that works around the lack the live range splitting. // 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 // Heuristics #1: Don't CSE "cheap" computation if the def is not local or in
// immediate predecessor. We don't want to increase register pressure and end up // an immediate predecessor. We don't want to increase register pressure and
// causing other computation to be spilled. // end up causing other computation to be spilled.
if (MI->getDesc().isAsCheapAsAMove()) { if (MI->getDesc().isAsCheapAsAMove()) {
MachineBasicBlock *CSBB = CSMI->getParent(); MachineBasicBlock *CSBB = CSMI->getParent();
MachineBasicBlock *BB = MI->getParent(); MachineBasicBlock *BB = MI->getParent();
if (CSBB != BB && if (CSBB != BB && !CSBB->isSuccessor(BB))
find(CSBB->succ_begin(), CSBB->succ_end(), BB) == CSBB->succ_end())
return false; return false;
} }