[PATCH vkd3d 04/17] vkd3d-shader/hlsl: Propagate constant loads in copy propagation.
Giovanni Mascellani
gmascellani at codeweavers.com
Thu Dec 2 09:02:50 CST 2021
Hi,
On 01/12/21 17:55, Matteo Bruni wrote:
> IIRC this patch gets rid of unnecessary copies from an immediate to a
> temporary variable. I already forgot the details but I'm pretty sure
> that it did something...
I already replied privately, but for the sake of having a publicly
archived reference, this patch converts this:
trace:hlsl_dump_function: 2: float | 1.00000000e+00
trace:hlsl_dump_function: 3: float | 2.00000000e+00
trace:hlsl_dump_function: 4: float | 3.00000000e+00
trace:hlsl_dump_function: 5: float | 4.00000000e+00
trace:hlsl_dump_function: 6: | = (<constructor-0>.x @2)
trace:hlsl_dump_function: 7: | = (<constructor-0>.y @3)
trace:hlsl_dump_function: 8: | = (<constructor-0>.z @4)
trace:hlsl_dump_function: 9: | = (<constructor-0>.w @5)
trace:hlsl_dump_function: 10: float4 | <constructor-0>
trace:hlsl_dump_function: 11: | return
to this:
trace:hlsl_dump_function: 2: float4 | {1.00000000e+00
2.00000000e+00 3.00000000e+00 4.00000000e+00 }
trace:hlsl_dump_function: 3: | return
It is not something 1/17 can (or should) be able to do. There might be a
better way to do this with more generality, but this is here right now,
so I think it makes sense to have it in master.
Giovanni.
More information about the wine-devel
mailing list