summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2016-10-03 18:55:09 +0200
committerSamuel Pitoiset <[email protected]>2016-10-05 19:11:42 +0200
commitd8bcd3ef3723e14a9deabd1cab35b13d80fbbcea (patch)
tree5b3db90e8146f06ec590b143d761ffef0c6932ea /src/gallium/drivers
parentf315c4f18987dc22d367361c1641a990eded42d6 (diff)
nv50/ra: let simplify return an error and handle that
fixes a crash in the case simplify reports an error Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
index 2d3486ba2bc..7e64f7ce92c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
@@ -771,7 +771,7 @@ private:
bool coalesce(ArrayList&);
bool doCoalesce(ArrayList&, unsigned int mask);
void calculateSpillWeights();
- void simplify();
+ bool simplify();
bool selectRegisters();
void cleanup(const bool success);
@@ -1305,7 +1305,7 @@ GCRA::simplifyNode(RIG_Node *node)
(node->degree < node->degreeLimit) ? "" : "(spill)");
}
-void
+bool
GCRA::simplify()
{
for (;;) {
@@ -1330,11 +1330,11 @@ GCRA::simplify()
}
if (isinf(bestScore)) {
ERROR("no viable spill candidates left\n");
- break;
+ return false;
}
simplifyNode(best);
} else {
- break;
+ return true;
}
}
}
@@ -1493,7 +1493,9 @@ GCRA::allocateRegisters(ArrayList& insns)
buildRIG(insns);
calculateSpillWeights();
- simplify();
+ ret = simplify();
+ if (!ret)
+ goto out;
ret = selectRegisters();
if (!ret) {