| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] |
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0004808 | OCaml | OCaml general | public | 2009-05-28 15:21 | 2012-04-08 19:35 |
|
| Reporter | jerhoud | |
| Assigned To | | |
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | resolved | Resolution | suspended | |
| Platform | | OS | | OS Version | |
| Product Version | 3.10.2 | |
| Target Version | | Fixed in Version | | |
|
| Summary | 0004808: better compilation of min and max |
| 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 0000263:0000004 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) |
| Tags | No tags attached. |
|
| Attached Files | |
|