nv50/ir: delete MINMAX instruction that is no longer in the BB
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 11 Nov 2018 07:19:36 +0000 (02:19 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 17 Nov 2018 01:53:09 +0000 (20:53 -0500)
We removed the op from the BB, but it was still listed in its sources'
uses. This could trip up some logic down the line which analyzes all the
uses of an l-value, e.g. spilling.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 8767e5efb99aab198fa784c3712054c33bcc4a5b..04d26dcbf53fd069b1b75d49e81326fc23a5064e 100644 (file)
@@ -1898,7 +1898,7 @@ AlgebraicOpt::handleMINMAX(Instruction *minmax)
    if (minmax->src(0).mod == minmax->src(1).mod) {
       if (minmax->def(0).mayReplace(minmax->src(0))) {
          minmax->def(0).replace(minmax->src(0), false);
-         minmax->bb->remove(minmax);
+         delete_Instruction(prog, minmax);
       } else {
          minmax->op = OP_CVT;
          minmax->setSrc(1, NULL);