forked from OSchip/llvm-project
Delete the heuristic for non-livein CopyFromReg nodes. Non-liveinness
is determined by whether the node has a Flag operand. However, if the node does have a Flag operand, it will be glued to its register's def, so the heuristic would end up spuriously applying to whatever node is the def. llvm-svn: 64319
This commit is contained in:
parent
5ee2c02ac6
commit
298a2946f1
|
@ -899,12 +899,6 @@ namespace {
|
||||||
};
|
};
|
||||||
} // end anonymous namespace
|
} // end anonymous namespace
|
||||||
|
|
||||||
static inline bool isCopyFromLiveIn(const SUnit *SU) {
|
|
||||||
SDNode *N = SU->getNode();
|
|
||||||
return N && N->getOpcode() == ISD::CopyFromReg &&
|
|
||||||
N->getOperand(N->getNumOperands()-1).getValueType() != MVT::Flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// CalcNodeSethiUllmanNumber - Compute Sethi Ullman number.
|
/// CalcNodeSethiUllmanNumber - Compute Sethi Ullman number.
|
||||||
/// Smaller number is the higher priority.
|
/// Smaller number is the higher priority.
|
||||||
static unsigned
|
static unsigned
|
||||||
|
@ -986,11 +980,6 @@ namespace {
|
||||||
unsigned getNodePriority(const SUnit *SU) const {
|
unsigned getNodePriority(const SUnit *SU) const {
|
||||||
assert(SU->NodeNum < SethiUllmanNumbers.size());
|
assert(SU->NodeNum < SethiUllmanNumbers.size());
|
||||||
unsigned Opc = SU->getNode() ? SU->getNode()->getOpcode() : 0;
|
unsigned Opc = SU->getNode() ? SU->getNode()->getOpcode() : 0;
|
||||||
if (Opc == ISD::CopyFromReg && !isCopyFromLiveIn(SU))
|
|
||||||
// CopyFromReg should be close to its def because it restricts
|
|
||||||
// allocation choices. But if it is a livein then perhaps we want it
|
|
||||||
// closer to its uses so it can be coalesced.
|
|
||||||
return 0xffff;
|
|
||||||
if (Opc == ISD::TokenFactor || Opc == ISD::CopyToReg)
|
if (Opc == ISD::TokenFactor || Opc == ISD::CopyToReg)
|
||||||
// CopyToReg should be close to its uses to facilitate coalescing and
|
// CopyToReg should be close to its uses to facilitate coalescing and
|
||||||
// avoid spilling.
|
// avoid spilling.
|
||||||
|
|
Loading…
Reference in New Issue