Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006354OCamlback end (clambda to assembly)public2014-03-26 22:402016-12-07 14:00
Reportergasche 
Assigned Toshinwell 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006354: [github patch] cmm arithmetic optimizations
DescriptionPatch and description at:
  https://github.com/ocaml/ocaml/pull/17/ [^]



Some optimisations on Cmm expressions involving tagging or constants. Here's a (best-case) example:

let int_of_digits a b c =
  100 * (Char.code a - Char.code '0') +
   10 * (Char.code b - Char.code '0') +
    1 * (Char.code c - Char.code '0')

Trunk compiles this to:

 (+
   (+ (+ (* 200 (>>s (+ a/1020 -96) 1)) (* 20 (>>s (+ b/1021 -96) 1)))
     (* 2 (>>s (+ c/1022 -96) 1)))
   1)

This branch compiles this to:

(+ (+ (+ ( * a/1020 100) ( * b/1021 10)) c/1022) -10766)

Floating all of the constant operations, tags, etc. out of arithmetic means they can be merged into one addition.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0016702)
shinwell (developer)
2016-12-07 14:00

This has been merged

- Issue History
Date Modified Username Field Change
2014-03-26 22:40 gasche New Issue
2014-07-16 15:39 doligez Status new => acknowledged
2016-12-07 14:00 shinwell Note Added: 0016702
2016-12-07 14:00 shinwell Status acknowledged => resolved
2016-12-07 14:00 shinwell Resolution open => fixed
2016-12-07 14:00 shinwell Assigned To => shinwell
2017-02-23 16:35 doligez Category OCaml backend (code generation) => Back end (clambda to assembly)
2017-02-23 16:44 doligez Category Back end (clambda to assembly) => back end (clambda to assembly)


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker