[PATCH vkd3d 1/3] vkd3d-shader/hlsl: Handle branches in copy propagation.
Zebediah Figura (she/her)
zfigura at codeweavers.com
Wed Jan 19 17:25:42 CST 2022
On 1/19/22 06:53, Giovanni Mascellani wrote:
> Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
> ---
> A new var_def is now initialized to the content of the same var_def
> in earlier stack frames.
>
> I still believe this is more complicated than it should be (i.e., harder
> to check and therefore more prone to bugs), but maybe it's correct anyway.
>
> Zebediah said she doesn't like it in this way, but I couldn't understand
> in which direction I should change it to make it better; since my last
> submission has been evicted from the patch tracker, I am sending again
> without changes.
As pointed out, the whole point of searching parent scopes (whether
recursively or with an array) in copy_propagation_get_var_def() is to
avoid duplicating the state. This patch feels like half of one thing and
half of the other.
Since we need a way to distinguish "written in this scope, and can be
resolved to a single instr" vs "written in this scope, and cannot be
resolved" vs "not written in this scope", that sounds to me like we need
to store an extra bool of information along with the hlsl_ir_node pointer.
More information about the wine-devel
mailing list