mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
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:
parent
9cc9f50abc
commit
622a11bc07
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user