summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/codegen
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-11-16 00:39:41 +0100
committerChristoph Bumiller <[email protected]>2012-04-14 21:54:00 +0200
commitfc740e7924dfa52a39de5f2b8031c2cded0fafb3 (patch)
tree6a6b8128f086eb01b6be07e8b6e30f824b89d9ab /src/gallium/drivers/nv50/codegen
parent349cb60ed58e42341351c5f0ebd186acb8f12005 (diff)
nv50/ir: fix insertHead and remove for BBs with PHI ops only
Diffstat (limited to 'src/gallium/drivers/nv50/codegen')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
index 83938edc389..fb4188870a6 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
@@ -104,7 +104,7 @@ BasicBlock::insertHead(Instruction *inst)
insertBefore(entry, inst);
} else {
if (phi) {
- insertAfter(phi, inst);
+ insertAfter(exit, inst); // after last phi
} else {
assert(!exit);
entry = exit = inst;
@@ -211,8 +211,15 @@ BasicBlock::remove(Instruction *insn)
else
exit = insn->prev;
- if (insn == entry)
- entry = insn->next ? insn->next : insn->prev;
+ if (insn == entry) {
+ if (insn->next)
+ entry = insn->next;
+ else
+ if (insn->prev && insn->prev->op != OP_PHI)
+ entry = insn->prev;
+ else
+ entry = NULL;
+ }
if (insn == phi)
phi = (insn->next && insn->next->op == OP_PHI) ? insn->next : 0;