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

better compilation of min and max #4808

Closed
vicuna opened this issue May 28, 2009 · 1 comment
Closed

better compilation of min and max #4808

vicuna opened this issue May 28, 2009 · 1 comment

Comments

@vicuna
Copy link

vicuna commented May 28, 2009

Original bug ID: 4808
Reporter: jerhoud
Status: resolved (set by @xavierleroy on 2012-04-08T17:35:02Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 3.10.2
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #5541
Monitored by: @ygrek @hcarty

Bug description

Pervasives functions min and max never get inlined because they are polymorphic.

Using min or max on int values implies 2 function calls (one to min or max and an indirect one to caml_lessequal).

A specialized version of min and max for type int gets inlined in ~4 simple assembler instructions.

A nice feature would be that polymorphic functions get inlined using the knowledge of the actual types of the arguments.

If this is too complicated (or not worth the work) perhaps min and max could be special for the compiler (like '<' is)

@vicuna
Copy link
Author

vicuna commented Apr 8, 2012

Comment author: @xavierleroy

Suspending this PR for reasons explained in #5541

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

Successfully merging a pull request may close this issue.

1 participant