On Sun Sep 10 08:14:07 2023 +0000, Francisco Casas wrote:
I don't understand ir.c very well yet. That said, I am not sure if flattener_eliminate_phase_related_dcls() is the right place to initialize `normaliser.last_ret_location`. Maybe initializing this value deserves a separated function, lest we forget that we are charging flattener_eliminate_phase_related_dcls() with this additional responsibility. Also, it seems to me that it could be a local variable in instruction_array_flatten_hull_shader_phases() instead of a member of the normalizer, unless there is another place where it could be used later.
I don't see this as very problematic: `flattener_eliminate_phase_related_dcls()` is just a helper for `instruction_array_flatten_hull_shader_phases()`, so both functions are basically in the same "domain of responsibility". Same thing for `struct hull_flattener`: it's just a helper structure to share variables between the main function and its helpers without passing a lot of arguments to each call.