Put a limit on ScheduleDAGSDNodes::ClusterNeighboringLoads to avoid blowing up compil...
authorAndrew Trick <atrick@apple.com>
Mon, 7 Apr 2014 21:29:22 +0000 (21:29 +0000)
committerAndrew Trick <atrick@apple.com>
Mon, 7 Apr 2014 21:29:22 +0000 (21:29 +0000)
commit7f7263354767fb201c53da88b83d1ec4e3511432
tree650e3024d1ee0a36cff93a5ba0f8d3811185d02e
parent1d8c7eb225672b08422089c12c0badf548882ff3
Put a limit on ScheduleDAGSDNodes::ClusterNeighboringLoads to avoid blowing up compile time.

Fixes PR16365 - Extremely slow compilation in -O1 and -O2.

The SD scheduler has a quadratic implementation of load clustering
which absolutely blows up compile time for large blocks with constant
pool loads. The MI scheduler has a better implementation of load
clustering. However, we have not done the work yet to completely
eliminate the SD scheduler. Some benchmarks still seem to benefit from
early load clustering, although maybe by chance.

As an intermediate term fix, I just put a nice limit on the number of
DAG users to search before finding a match. With this limit there are no
binary differences in the LLVM test suite, and the PR16365 test case
does not suffer any compile time impact from this routine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205738 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp