nv50/ir: when constant folding shl(mul, a) we need to copy muls type

Also clear subop while at it as we might convert a shl.wrap to mul.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11021>
This commit is contained in:
Karol Herbst 2021-05-27 00:21:31 +02:00 committed by Marge Bot
parent 5e88a1caca
commit e7485f1294
1 changed files with 3 additions and 0 deletions

View File

@ -1502,6 +1502,9 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
bld.setPosition(i, false);
i->op = OP_MUL;
i->subOp = 0;
i->dType = si->dType;
i->sType = si->sType;
i->setSrc(0, si->getSrc(!muls));
i->setSrc(1, bld.loadImm(NULL, imm1.reg.data.u32 << imm0.reg.data.u32));
break;