Skip to content

Commit

Permalink
{mesa 3e468ff2 cherrypick} nv50/ir: handle insn not being there for d…
Browse files Browse the repository at this point in the history
…efinition of CVT arg

This can happen if it's e.g. a uniform or a function argument.
  • Loading branch information
fincs committed Jan 22, 2020
1 parent adc138f commit 315a736
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesa-imported/codegen/nv50_ir_peephole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 315a736

Please sign in to comment.