diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index e0faf8501bf..520cbee7c1a 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -3472,6 +3472,11 @@ Instruction::isActionEqual(const Instruction *that) const } else if (this->asFlow()) { return false; + } else + if (this->op == OP_PHI && this->bb != that->bb) { + /* TODO: we could probably be a bit smarter here by following the + * control flow, but honestly, it is quite painful to check */ + return false; } else { if (this->ipa != that->ipa || this->lanes != that->lanes || @@ -3568,6 +3573,7 @@ GlobalCSE::visit(BasicBlock *bb) break; } if (!phi->srcExists(s)) { + assert(ik->op != OP_PHI); Instruction *entry = bb->getEntry(); ik->bb->remove(ik); if (!entry || entry->op != OP_JOIN)