Hi,
Il 25/01/22 20:06, Zebediah Figura (she/her) ha scritto:
I'd also suggest specifying both dsts as optional hlsl_ir_node pointers, where NULL translates to SM4_RT_NULL. That would allow you to use this helper even if both dsts are used.
Actually, a difficulty with this approach is that then, if both destinations are specified, we don't know which one is to be used to map the sources' writemasks. The ways out I see are to add another argument to specify it, to assume that they are identical so either can be used or to keep the current interface with which exactly one destination is non-NULL (it's true that it is more constraining, but my, admittedly probably poor, understanding of Matteo's intentions is that optimizations like the one you say are going to happen at a lower level, so I wouldn't bother for the time being).
Which one do you prefer?
Giovanni.