[PBQP Regalloc] Pre-spill vregs that have no legal physregs.
authorLang Hames <lhames@gmail.com>
Tue, 3 Feb 2015 06:14:06 +0000 (06:14 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 3 Feb 2015 06:14:06 +0000 (06:14 +0000)
commitd54450ef63998effdb19476c4e4c6c3f0a8c5f50
tree30a2bd73ec9730a0bcd4163bedcc50df52efccdc
parent56756c43cd588d6f0565746b5aaef366af7b9d19
[PBQP Regalloc] Pre-spill vregs that have no legal physregs.

The PBQP::RegAlloc::MatrixMetadata class assumes that matrices have at least two
rows/columns (for the spill option plus at least one physreg). This patch
ensures that that invariant is met by pre-spilling vregs that have no physreg
options so that no node (and no corresponding edges) need be added to the PBQP
graph.

This fixes a bug in an out-of-tree target that was identified by Jonas Paulsson.
Thanks for tracking this down Jonas!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227942 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/RegAllocPBQP.h
lib/CodeGen/RegAllocPBQP.cpp