Skip to content

NCG: Fix a bug where we errounously removed a required jump instruction.

Andreas Klebinger requested to merge wip/andreask/fix_fallthrough into master
NCG: Fix a bug where we errounously removed a required jump instruction.

Add a new method to the Instruction class to check if we can eliminate a
jump in favour of fallthrough control flow.

Fixes #24507

I had considered changing the behaviour of jumpDestsOfInstruction but that seemed overly messy.

I had also tried (ab)using canShortcut for this but this also turned out to be messy and slightly nonsensically. For example a backend might not support shortcutting, but it should still support this far simplier method of eliminating some redundant jumps.

Merge request reports