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

inlining #8355

Closed
vicuna opened this issue Nov 3, 2003 · 1 comment
Closed

inlining #8355

vicuna opened this issue Nov 3, 2003 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Nov 3, 2003

Original bug ID: 1913
Reporter: administrator
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2016-12-06T20:50:11Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Monitored by: bobot

Bug description

Bonjour,

pas vraiment un bug mais un comportement génant d'ocamlopt: il semble
que le code correspondant à une fonction soit généré même si toutes
les occurrences d'appel de la fonction ont été inlinés. Ça n'est pas
bien génant pour des fonctions globales mais dans le cas de figure qui
m'intéresse (une fonction locale au sein d'une fonction récursive),
c'est assez catastrophique. Mon code a l'allure suivante:

let rec f i =
let f' () = f (i+1) in
f' ()

L'inlining est fait correctement mais la douzaine d'instructions de
construction de la clôture est un peu couteuse (en particulier à cause
de l'allocation mémoire).

Est-ce qu'on peut améliorer ça ? Sinon je vais revoir mon style
de programmation :-(

--Pascal

@vicuna
Copy link
Author

vicuna commented Dec 6, 2016

Comment author: @mshinwell

Flambda correctly removes the closure allocation

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

No branches or pull requests

2 participants