From 315a7365a88d66ab608a9021c2e679604a5ad588 Mon Sep 17 00:00:00 2001 From: fincs Date: Wed, 22 Jan 2020 16:30:43 +0100 Subject: [PATCH] {mesa 3e468ff2 cherrypick} 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. --- mesa-imported/codegen/nv50_ir_peephole.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesa-imported/codegen/nv50_ir_peephole.cpp b/mesa-imported/codegen/nv50_ir_peephole.cpp index ac61c27..fe22c7c 100644 --- a/mesa-imported/codegen/nv50_ir_peephole.cpp +++ b/mesa-imported/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;