diff options
author | Lang Hames <lhames@gmail.com> | 2010-09-21 13:19:36 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2010-09-21 13:19:36 +0000 |
commit | e9c935662d77b8c5a3a26f5622dc2a3ed22d75c8 (patch) | |
tree | 8ff793b0647dea1bf3cea693363873c905759d3d /include/llvm/CodeGen/PBQP | |
parent | 04ac81d5db058a3a9492e1aff1f398a8643bfda9 (diff) | |
download | external_llvm-e9c935662d77b8c5a3a26f5622dc2a3ed22d75c8.zip external_llvm-e9c935662d77b8c5a3a26f5622dc2a3ed22d75c8.tar.gz external_llvm-e9c935662d77b8c5a3a26f5622dc2a3ed22d75c8.tar.bz2 |
Added an additional PBQP problem builder which adds coalescing costs (both between pairs of virtuals, and between virtuals and physicals).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/PBQP')
-rw-r--r-- | include/llvm/CodeGen/PBQP/Heuristics/Briggs.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h b/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h index 18eaf7c..47a287c 100644 --- a/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h +++ b/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h @@ -63,8 +63,12 @@ namespace PBQP { SpillCostComparator(HeuristicSolverImpl<Briggs> &s) : s(&s), g(&s.getGraph()) {} bool operator()(Graph::NodeItr n1Itr, Graph::NodeItr n2Itr) const { - PBQPNum cost1 = g->getNodeCosts(n1Itr)[0] / s->getSolverDegree(n1Itr), - cost2 = g->getNodeCosts(n2Itr)[0] / s->getSolverDegree(n2Itr); + const PBQP::Vector &cv1 = g->getNodeCosts(n1Itr); + const PBQP::Vector &cv2 = g->getNodeCosts(n2Itr); + + PBQPNum cost1 = cv1[0] / s->getSolverDegree(n1Itr); + PBQPNum cost2 = cv2[0] / s->getSolverDegree(n2Itr); + if (cost1 < cost2) return true; return false; |