diff options
author | Dan Gohman <gohman@apple.com> | 2009-02-11 21:29:39 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-02-11 21:29:39 +0000 |
commit | c8db34cb07fea88c4b8f3e0f095fd8aed568b28e (patch) | |
tree | 180555e018ae5b9046d0ff282acb5183c7f73556 /lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | |
parent | 8bb332d45dd266b9678446cea5812371d8d3e8af (diff) | |
download | external_llvm-c8db34cb07fea88c4b8f3e0f095fd8aed568b28e.tar.gz external_llvm-c8db34cb07fea88c4b8f3e0f095fd8aed568b28e.tar.bz2 external_llvm-c8db34cb07fea88c4b8f3e0f095fd8aed568b28e.zip |
Don't use special heuristics for nodes with no data predecessors
unless they actually have data successors, and likewise for nodes
with no data successors unless they actually have data precessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 55780e4091..0b7f99f42a 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -989,15 +989,16 @@ namespace { // EXTRACT_SUBREG / INSERT_SUBREG should be close to its use to // facilitate coalescing. return 0; - if (SU->NumSuccs == 0) - // If SU does not have a use, i.e. it doesn't produce a value that would - // be consumed (e.g. store), then it terminates a chain of computation. - // Give it a large SethiUllman number so it will be scheduled right - // before its predecessors that it doesn't lengthen their live ranges. + if (SU->NumSuccs == 0 && SU->NumPreds != 0) + // If SU does not have a register use, i.e. it doesn't produce a value + // that would be consumed (e.g. store), then it terminates a chain of + // computation. Give it a large SethiUllman number so it will be + // scheduled right before its predecessors that it doesn't lengthen + // their live ranges. return 0xffff; - if (SU->NumPreds == 0) - // If SU does not have a def, schedule it close to its uses because it - // does not lengthen any live ranges. + if (SU->NumPreds == 0 && SU->NumSuccs != 0) + // If SU does not have a register def, schedule it close to its uses + // because it does not lengthen any live ranges. return 0; return SethiUllmanNumbers[SU->NodeNum]; } |