summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-01 22:39:30 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-01 22:39:30 +0000
commit1359196c4e617db3cbf19507ed2ac8a2160ca15e (patch)
tree8a3695121465b1094c081e052a36cd5b0a6f9a2c
parent44519a8feb85567211b257682f8980a0beddb60b (diff)
downloadbcm5719-llvm-1359196c4e617db3cbf19507ed2ac8a2160ca15e.tar.gz
bcm5719-llvm-1359196c4e617db3cbf19507ed2ac8a2160ca15e.zip
Clean up.
llvm-svn: 31359
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index 0e63817e23b..7704a531aff 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -719,7 +719,14 @@ int BURegReductionPriorityQueue<SF>::CalcNodePriority(const SUnit *SU) {
return SethiUllmanNumber;
unsigned Opc = SU->Node->getOpcode();
- if (Opc == ISD::TokenFactor || Opc == ISD::CopyToReg)
+ 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 the
+ // uses so it can be coalesced.
+ SethiUllmanNumber = INT_MIN + 10;
+ else if (Opc == ISD::TokenFactor || Opc == ISD::CopyToReg)
+ // CopyToReg should be close to its uses to facilitate coalescing and avoid
+ // spilling.
SethiUllmanNumber = INT_MAX - 10;
else if (SU->NumSuccsLeft == 0)
// If SU does not have a use, i.e. it doesn't produce a value that would
@@ -727,10 +734,9 @@ int BURegReductionPriorityQueue<SF>::CalcNodePriority(const SUnit *SU) {
// Give it a small SethiUllman number so it will be scheduled right before its
// predecessors that it doesn't lengthen their live ranges.
SethiUllmanNumber = INT_MIN + 10;
- // FIXME: remove this else if? It seems to reduce register spills but often
- // ends up increasing runtime. Need to investigate.
- else if (SU->NumPredsLeft == 0 &&
- (Opc != ISD::CopyFromReg || isCopyFromLiveIn(SU)))
+ else if (SU->NumPredsLeft == 0)
+ // If SU does not have a def, schedule it close to its uses because it does
+ // not lengthen any live ranges.
SethiUllmanNumber = INT_MAX - 10;
else {
int Extra = 0;
OpenPOWER on IntegriCloud