Conversation
Constant additions and tagging operations are moved out of subexpressions when possible. Often they can be merged.
asmcomp/cmmgen.ml
Outdated
There was a problem hiding this comment.
From the name of the function, it is not obvious that the result is the tagged result minus one. You should probably move the 'incr_int' here.
|
Thanks for the quick response, sorry it took me a while to get back. I've fixed the things you pointed out. A couple of days ago, you said that it might have O(n^2) behaviour. I'm fairly sure it doesn't: In a test, compiling a function |
|
I know, I deleted the comment for that reason... The quadratic behaviour for a long addition is probably due to register allocation (or more precisely constraints generation). Now this patch looks ok to me. |
|
It would be great to optimize logical operations as well. |
|
This PR have been discussed during the last developers' meeting, where I had the pleasure to be. To sum-up:
|
|
Would it be possible for me to write & submit a fixed patch? |
|
@drbo no objection from me! Sorry I haven't had a chance to fix this up recently. |
Add | on initial match case, and use Sys.word_size
|
Finally fixed this, sorry everyone for the delay. |
|
Merged in trunk@15820, thanks! |
Constant additions and tagging operations are moved out of subexpressions when possible. Often they can be merged. From Stephen Dolan: #17 git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15820 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Constant additions and tagging operations are moved out of subexpressions when possible. Often they can be merged. From Stephen Dolan: ocaml#17 git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15820 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Constant additions and tagging operations are moved out of subexpressions when possible. Often they can be merged. From Stephen Dolan: #17 git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15820 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Fixes ocaml#17. (hopefully!)
Added continuation cloning
…alizer_promote minor gc promote all finalizers objects
ce88833 Merge flambda-backend changes b7506bb Revert "Cherry-pick of ocaml/ocaml 1eeb0e7 (ocaml#12)" 183f688 Add config option to enable/disable stack allocation (ocaml#22) ee7c849 If both the type and mode of an ident are wrong, complain about the type. (ocaml#19) 44bade0 Allow submoding during module inclusion checks (ocaml#21) de3bec9 Add subtyping between arrows of related modes (ocaml#20) 93d8615 Enable the local keywords even when the local extension is off (ocaml#18) 81dd85e Documentation for local allocations b05519f Fix a GC bug in local stack scanning (ocaml#17) 9f879de Fix __FUNCTION__ (ocaml#15) a78975e Optimise "include struct ... end" in more cases (ocaml#11134) b819c66 Cherry-pick of ocaml/ocaml 1eeb0e7 (ocaml#12) bb363d4 Optimise the allocation of optional arguments (ocaml#11) git-subtree-dir: ocaml git-subtree-split: ce88833
The stack pointer was computed relative to the wrong local arena
Fix crash when using lifted module that contains macros
* Add the preview templates * Add a tutorials index page * Add a no_trailing_slash middleware
Some optimisations on Cmm expressions involving tagging or constants. Here's a (best-case) example:
Trunk compiles this to:
This branch compiles this to:
Floating all of the constant operations, tags, etc. out of arithmetic means they can be merged into one addition.