Matrix simplification in PBQP may push infinite costs onto register options.

The colorability heuristic should count these as denied registers.

No test case - this exposed a bug on an out-of-tree target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153958 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames 2012-04-03 16:27:16 +00:00
parent 75e3b7fb8f
commit d5be48a9db

View File

@ -418,6 +418,12 @@ namespace PBQP {
unsigned numRegs = getGraph().getNodeCosts(nItr).getLength() - 1;
nd.numDenied = 0;
const Vector& nCosts = getGraph().getNodeCosts(nItr);
for (unsigned i = 1; i < nCosts.getLength(); ++i) {
if (nCosts[i] == std::numeric_limits<PBQPNum>::infinity())
++nd.numDenied;
}
nd.numSafe = numRegs;
nd.unsafeDegrees.resize(numRegs, 0);