mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
[PBQP] NDEBUG guards added around code needed for assert.
wasConservativelyAllocatable() is only called to assert that a conservatively allocatable node wasn't forced to spill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229477 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -144,6 +144,7 @@ namespace PBQP {
|
||||
// TODO: Try to normalize newly added/modified edge.
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Does this Cost vector have any register options ?
|
||||
template <typename VectorT>
|
||||
bool hasRegisterOptions(const VectorT &V) {
|
||||
@@ -161,6 +162,7 @@ namespace PBQP {
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// \brief Find a solution to a fully reduced graph by backpropagation.
|
||||
//
|
||||
@@ -187,12 +189,14 @@ namespace PBQP {
|
||||
|
||||
RawVector v = G.getNodeCosts(NId);
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Although a conservatively allocatable node can be allocated to a register,
|
||||
// spilling it may provide a lower cost solution. Assert here that spilling
|
||||
// is done by choice, not because there were no register available.
|
||||
if (G.getNodeMetadata(NId).wasConservativelyAllocatable())
|
||||
assert(hasRegisterOptions(v) && "A conservatively allocatable node "
|
||||
"must have available register options");
|
||||
#endif
|
||||
|
||||
for (auto EId : G.adjEdgeIds(NId)) {
|
||||
const Matrix& edgeCosts = G.getEdgeCosts(EId);
|
||||
|
||||
Reference in New Issue
Block a user