Disable physical register coalescing when the number of live ranges for the
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 9 Mar 2010 00:59:48 +0000 (00:59 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 9 Mar 2010 00:59:48 +0000 (00:59 +0000)
commit35071a08470b56dff90697618682720df7d3896c
treeac0f9a3fa82621ab6f2bd49c6af10fafbddae380
parent4b945500a5eb1b32ee8004e40e386105ee5815eb
Disable physical register coalescing when the number of live ranges for the
physreg becomes ridiculously high.

std::upper_bound may be log(N), but for sufficiently large live intervals, it
becomes log(N)*cachemiss = a long long time.

This patch improves coalescer time by 4500x for a function with 20000
function calls. The generated code is different, but not significantly worse -
the allocator hints are almost as good as physreg coalescing anyway.

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