aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-05-05 19:32:21 +0000
committerAndrew Trick <atrick@apple.com>2011-05-05 19:32:21 +0000
commitee1091589225d8de4cb8bc065bff9376bbe661eb (patch)
treeae8477dcc5244a3e8d0d660398d628b177a3bbca
parentf405b1ad19940ddd0b66ec0761e636b953af2c2e (diff)
ARM post RA scheduler compile time fix.
BuildSchedGraph was quadratic in the number of calls in the basic block. After this fix, it keeps only a single call at the top of the DefList so compile time doesn't blow up on large blocks. This reduces postRA sched time on an external test case from 81s to 0.3s. Although r130800 (reduced ARM register alias defs) also partially fixes the issue by reducing the constant overhead of checking call interference by an order of magnitude. Fixes <rdar://problem/7662664> very poor compile time with post RA scheduling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130943 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/ScheduleDAGInstrs.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp
index c8db1de332..b56f1421ba 100644
--- a/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -393,6 +393,18 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
UseList.clear();
if (!MO.isDead())
DefList.clear();
+
+ // Calls will not be reordered because of chain dependencies (see
+ // below). Since call operands are dead, calls may continue to be added
+ // to the DefList making dependence checking quadratic in the size of
+ // the block. Instead, we leave only one call at the back of the
+ // DefList.
+ //
+ // NOTE: This assumes that the DefList is ordered!
+ if (SU->isCall) {
+ while (!DefList.empty() && DefList.back()->isCall)
+ DefList.pop_back();
+ }
DefList.push_back(SU);
} else {
UseList.push_back(SU);