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

Feature: control inlining better #5873

Closed
vicuna opened this issue Jan 4, 2013 · 1 comment
Closed

Feature: control inlining better #5873

vicuna opened this issue Jan 4, 2013 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Jan 4, 2013

Original bug ID: 5873
Reporter: gerd
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2016-12-06T21:54:42Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 4.00.1
Fixed in version: 4.03.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #5872
Monitored by: @gasche @lefessan @diml @jberdine @alainfrisch

Bug description

I propose to add a feature for controlling inlining, in order to prevent performance bugs like #5872.

There are basically two options: instruct the compiler about inlining, or check inlining afterward:

  1. The compiler could honour a new command-line option [-inline-function name] which would recommend this function for inlining. If it is not inlined, a warning is emitted (and if the warning is fatal, an error).

  2. Extend ocamlobjinfo so that it can check whether a function was inlined. Add switch: [-check-inlining name] which outputs something when the function (identified by an OCaml identifier, not by an asm symbol) is not marked for inlining, and the exit code is non-0 in this case.

Of course, the goal of adding such a feature is to include the recommendations or checks into the build, so that we get automation. This is especially useful because OCaml doesn't define when inlining is possible, and because every OCaml version may behave differently in this respect.

@vicuna
Copy link
Author

vicuna commented Dec 6, 2016

Comment author: @mshinwell

Flambda provides attributes to control inlining and inlining reports to show which inlinings did and did not happen. I think this should suffice.

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