Skip to content

[x86 / Refactor] Safety checks on TEST removals and better FLAG tracking

This merge request adds some safety checks for the recent New TEST optimisations. It doesn't change the generated code, but the compiler is being more conservative and extra-safe with the code generation, specifically:

  • The second TEST instruction (if it isn't identical to the first one) is no longer removed if the FLAGS register is still in use.
  • The FLAGS register is allocated between the two jumps if only the second TEST instruction is removed, so the tracking doesn't deallocate it and immediately allocate it again without initialising it, and instead it remains allocated throughout.

Merge request reports