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

Pervasives.min/max are not inlined #5541

Closed
vicuna opened this issue Mar 15, 2012 · 1 comment
Closed

Pervasives.min/max are not inlined #5541

vicuna opened this issue Mar 15, 2012 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Mar 15, 2012

Original bug ID: 5541
Reporter: gerd
Status: resolved (set by @xavierleroy on 2012-03-16T09:12:37Z)
Resolution: suspended
Priority: normal
Severity: tweak
Version: 3.12.1
Category: back end (clambda to assembly)
Has duplicate: #4808 #5592
Monitored by: ronan.lehy@gmail.com mehdi dario Camarade_Tux @hcarty @Chris00

Bug description

I just observed that min/max are not inlined. This prevents that further optimizations on the comparison operator can be applied - min/max always use compare_val.

Maybe compiling Pervasives with a slightly increased inlining limit already solves the problem.

Steps to reproduce

ocamlobjinfo /pervasives.cmx

@vicuna
Copy link
Author

vicuna commented Mar 16, 2012

Comment author: @xavierleroy

Unfortunately, type-based specialization of comparisons takes place before inlining. In other words, even if min & max were inlined, they would still use the generic comparison operator. That's one of the several weaknesses of the OCaml inliner. I'm not expecting a solution soon, which is why I'm putting this PR in "suspended" state.

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