Maybe in a separate change. I'd want to double check on all gens. I think the thing I suggested is sufficient. On Apr 29, 2017 8:09 PM, "Karol Herbst" wrote: 2017-04-30 0:28 GMT+02:00 Ilia Mirkin : > On Sat, Apr 29, 2017 at 6:09 PM, Karol Herbst wrote: >> helps two alien isolation shaders >> >> shader-db: >> total instructions in shared programs : 4251497 -> 4251494 (-0.00%) >> total gprs used in shared programs : 513962 -> 513962 (0.00%) >> total local used in shared programs : 29797 -> 29797 (0.00%) >> total bytes used in shared programs : 38960264 -> 38960232 (-0.00%) >> >> local gpr inst bytes >> helped 0 0 2 2 >> hurt 0 0 0 0 >> >> v2: handle potential mods on src0 >> >> Signed-off-by: Karol Herbst >> Reviewed-by: Samuel Pitoiset >> Reviewed-by: Ilia Mirkin >> --- >> src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> index 015def0391..82da0d3e48 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> @@ -1284,6 +1284,13 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) >> >> case OP_SHL: >> { >> + if (s == 1 && imm0.isInteger(0)) { >> + i->op = i->src(0).mod.getOp(); >> + if (i->op != OP_CVT) >> + i->src(0).mod = 0; > > Is this necessary? Presumably if the op != 0, then op == OP_CVT... > yeah, no idea. I just thought I do it right when I actually depend on the getOp magic. But we can't emit any mods to begin with, so maybe we should just drop the mod handling and be done with it? >> + i->setSrc(1, NULL); >> + break; >> + } >> if (s != 1 || i->src(0).mod != Modifier(0)) >> break; >> // try to concatenate shifts >> -- >> 2.12.2 >>