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. llvm-svn: 130943
This commit is contained in:
parent
24b1c48514
commit
3dc73aae5e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue