We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code:
let[@inline never] failure _ = failwith "..." type t = | A | B | C let of_int_exn = function | 0 -> A | 1 -> B | 2 -> C | n -> failure n
generates:
cmpq $5, %rax jbe .L1 jmp camlA__failure_0_2_code@PLT .L1: ret
which is rather good, but contains one unnecessary jump.
The reason why it is not optimized away is that the CFG representation does not see two jumps, but only a conditional jump and a (direct) tail call.
It seems possible to slightly alter the CFG representation so that for instance the destinations of conditional jumps are not mere labels but symbols.
However, doing so would have an impact on a number of existing passes, for instance the jump-on-jump optimization or the zero-alloc checker.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following code:
generates:
which is rather good, but contains one unnecessary jump.
The reason why it is not optimized away is that the CFG
representation does not see two jumps, but only a conditional
jump and a (direct) tail call.
It seems possible to slightly alter the CFG representation
so that for instance the destinations of conditional jumps
are not mere labels but symbols.
However, doing so would have an impact on a number
of existing passes, for instance the jump-on-jump optimization
or the zero-alloc checker.
The text was updated successfully, but these errors were encountered: