nv50/ir/opt: don't delete instruction in removeFlow before its last use
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 22 Mar 2012 10:59:32 +0000 (11:59 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 14 Apr 2012 19:54:02 +0000 (21:54 +0200)
src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp

index 259bb5636c5e9faaf371f3dc06081c82fe4f0793..a45d336b43591f9632c5e66ceb02815d7d2ceb18 100644 (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