summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-02-27 21:08:57 +0100
committerChristoph Bumiller <[email protected]>2013-03-12 12:55:34 +0100
commite9294e11b452e8ad159496abecf7fd0f406b0fe2 (patch)
treea4978ef863a89aeecefc6eb2169730333c364c35 /src/gallium/drivers
parentee431b12ec9586e9fad058014ec9f4c667055d48 (diff)
nv50/ir/ra: make sure all used function inputs get assigned a reg
A live range [0, 0) counts as empty. For function inputs this can be a problem, so insert a nop at the beginning to make it [0, 1). This is a bit of a hack but also the most simple solution.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
index 5e5255fc4f8..e0fea4b9337 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
@@ -1586,6 +1586,13 @@ RegAlloc::execFunc()
unsigned int i, retries;
bool ret;
+ if (!func->ins.empty()) {
+ // Insert a nop at the entry so inputs only used by the first instruction
+ // don't count as having an empty live range.
+ Instruction *nop = new_Instruction(func, OP_NOP, TYPE_NONE);
+ BasicBlock::get(func->cfg.getRoot())->insertHead(nop);
+ }
+
ret = insertConstr.exec(func);
if (!ret)
goto out;