Matrix simplification in PBQP may push infinite costs onto register options.
authorLang Hames <lhames@gmail.com>
Tue, 3 Apr 2012 16:27:16 +0000 (16:27 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 3 Apr 2012 16:27:16 +0000 (16:27 +0000)
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

include/llvm/CodeGen/PBQP/Heuristics/Briggs.h

index e96c4cb1e0c1be67e514dd237c382a3a0244b3dd..a859e5899f063cf3a8f8dd24ac938d6c666934d4 100644 (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);