Skip to content
New issue

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

Unbox floats used in inlined calls #158

Open
bluddy opened this issue Jul 12, 2016 · 3 comments
Open

Unbox floats used in inlined calls #158

bluddy opened this issue Jul 12, 2016 · 3 comments

Comments

@bluddy
Copy link

bluddy commented Jul 12, 2016

In the following example, x is not unboxed:

let _ =
  let f = 100. in
  let [@inline always] rec loop x  =
    if x <= 0. then 0.
    else loop (x -. 5.)
  in
  loop f
@chambart
Copy link
Member

Something enabling that (not only when inlined in fact) has been attempted before, see https://github.com/chambart/ocaml/tree/float_args
This will definitely be done at some point, but needs some big changes in the backend first: #153

@alainfrisch
Copy link

There are really two ways to attack the problem: either support unboxed calling conventions in general, or optimize the recursive loop into a function-local loop (perhaps using "extended local exceptions") and then rely on the current unboxing strategy (in cmmgen). The latter is more restricted in scope but also simpler to achieve and it could give better performance (in addition to avoiding unboxing, it could benefit from better register allocation).

@bluddy
Copy link
Author

bluddy commented Jul 15, 2016

Sorry for double-posting this issue. It's also available on mantis here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants