nv50/ir/opt: don't delete instruction in removeFlow before its last use

This commit is contained in:
Christoph Bumiller 2012-03-22 11:59:32 +01:00
parent be161e66d6
commit d41f293bf0
1 changed files with 2 additions and 2 deletions

View File

@ -1737,10 +1737,10 @@ FlatteningPass::removeFlow(Instruction *insn)
if (term->op != OP_JOIN)
return;
delete_Instruction(prog, term);
Value *pred = term->getPredicate();
delete_Instruction(prog, term);
if (pred && pred->refCount() == 0) {
Instruction *pSet = pred->getUniqueInsn();
pred->join->reg.data.id = -1; // deallocate