From: Ilia Mirkin Date: Fri, 26 Jul 2019 05:01:45 +0000 (-0400) Subject: nv50/ir: handle insn not being there for definition of CVT arg X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e468ff2feb3fce4909ea35e7212bb99601ea816;p=mesa.git nv50/ir: handle insn not being there for definition of CVT arg 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 Reviewed-by: Karol Herbst Cc: mesa-stable@lists.freedesktop.org --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 0b3220903b9..bfdb923379b 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -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;