On Thu Jun 29 17:54:53 2023 +0000, Nikolay Sivov wrote:
It's spread out more, that's true, but it is simpler than trying to fix up instructions later, is easier to understand and shorter to read. Regarding https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/245#note_37287, we should probably reuse existing scope for initialization part. So, any suggestion how to proceed? I find an option of always creating correct list for KW_CONTINUE better.
Generally I prefer the new approach (store the iteration instruction list and then copy it directly before each `continue`) rather than the old one (first generate code without the iteration instructions and then patch it). One of the reasons is that, as you said, it's good that the IR has a well-defined meaning independently of the processing stage.
I can't exclude that some details could be refined a little bit, but the current proposal is fine for me.