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