nv50/ir: handle insn not being there for definition of CVT arg
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 26 Jul 2019 05:01:45 +0000 (01:01 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 27 Jul 2019 22:24:11 +0000 (18:24 -0400)
This can happen if it's e.g. a uniform or a function argument.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111217
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 0b3220903b9f33bcfa488183bb06736c42dd2ca1..bfdb923379b65b25b2e05c41ed230310d4306659 100644 (file)
@@ -2080,14 +2080,15 @@ void
 AlgebraicOpt::handleCVT_CVT(Instruction *cvt)
 {
    Instruction *insn = cvt->getSrc(0)->getInsn();
-   RoundMode rnd = insn->rnd;
 
-   if (insn->saturate ||
+   if (!insn ||
+       insn->saturate ||
        insn->subOp ||
        insn->dType != insn->sType ||
        insn->dType != cvt->sType)
       return;
 
+   RoundMode rnd = insn->rnd;
    switch (insn->op) {
    case OP_CEIL:
       rnd = ROUND_PI;