From d5be48a9db6bf9b1b399e1309b9654e06a616165 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 3 Apr 2012 16:27:16 +0000 Subject: [PATCH] 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 --- include/llvm/CodeGen/PBQP/Heuristics/Briggs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h b/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h index e96c4cb1e0c..a859e5899f0 100644 --- a/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h +++ b/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h @@ -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::infinity()) + ++nd.numDenied; + } + nd.numSafe = numRegs; nd.unsafeDegrees.resize(numRegs, 0);