OSDN Git Service

[PBQP] Cautiously update edge costs in the solver
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>
Wed, 11 Feb 2015 08:25:36 +0000 (08:25 +0000)
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>
Wed, 11 Feb 2015 08:25:36 +0000 (08:25 +0000)
commit8ee1b65836500a588b6086aef720fae916958e16
treeb7b696a2d92ec6637942651c2952fc77c33f803a
parente37f2a0dc69326363cbe0b1e7a4120e71814deaf
[PBQP] Cautiously update edge costs in the solver

The NodeMetadata are maintained in an incremental way. When an edge between
2 nodes has its cost updated, in the course of graph reduction for example,
the NodeMetadata need first to have the old edge cost removed, then the new
edge cost added. Only once the NodeMetadata have been fully updated, it
becomes safe to consider promoting the nodes to the
ConservativelyAllocatable or OptimallyReducible sets. Previously, this
promotion was occuring right after the removing the old cost, and this was
breaking the assumption that a ConservativelyAllocatable should not be
spilled.

This patch also adds asserts to:
 - enforces the invariant that a node's reduction can not be downgraded,
 - only not provably allocatable or optimally reducible nodes can be spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228816 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/PBQP/Graph.h
include/llvm/CodeGen/PBQP/ReductionRules.h
include/llvm/CodeGen/RegAllocPBQP.h
lib/CodeGen/RegAllocPBQP.cpp
lib/Target/AArch64/AArch64PBQPRegAlloc.cpp