On Wed Jan 11 19:23:19 2023 +0000, Francisco Casas wrote:
Oh, I remember why I made `copy_propagation_compute_load_constant_replacement()` receive the whole instruction as an argument. It is that the swizzle alone doesn't convey number of components requested, and that also isn't in the load itself, but rather in the swizzle instruction. I should add it as an additional argument then.
Actually, this doesn't make much sense:
``` static bool copy_propagation_transform_swizzle(...) { ...
if (swizzle->val->type != HLSL_IR_LOAD) return false;
return copy_propagation_transform_load(ctx, hlsl_ir_load(swizzle->val), state, swizzle->swizzle); } ```
because calling `copy_propagation_transform_load` would be replacing the swizzle's load, and not the swizzle itself. So I'm going to skip that part of the advice and see where I get to.