| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Stop using integer comparison on potential pointers
|
| | |
|
| | |
|
|/
|
| |
Add manual chapters on parallelism and memory model
|
|
|
| |
paramter -> parameter
|
|
|
|
|
| |
Extend the typedtree with a location field for assertions, which is
taken from the location stack of the parsetree.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change fixes a small bug (that would lead to missed optimization
opportunities, not miscompilation I believe) in lambda/switch.ml,
where a test that should be equivalent to (len1 < 2) was in fact
written in a form equivalent to (len1 <= 2), missing an improvement
opportunity for the case len1=2.
The use of min/max is an additional simplification in this exact same
part of the code.
closes #10465
Suggested by Michael Rose.
|
| |
|
|
|
|
|
|
|
| |
* Fix composition of coercions with aliases
* Changes
* Add test
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
fix a minor regression from #10462
(cherry picked from commit c8c51a735d3cd4695892012f5aaab103b6a6cacf)
|
|
|
|
|
| |
DEFAULT_STRING=unsafe (#10893)
The compiler should behave as previous versions with `force-safe-string` enabled, and reject with an error any explicit setting that would try to deviate from that.
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
This reverts commit efb4a8d5cf0bb77fb8bba41e1d76172af7f78162.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
(suggestion from Konstantin Romanov)
|
| | |
|
| | |
|
| |
| |
| |
| | |
Co-Authored-By: Pierre Chambart
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(suggestion from Konstantin Romanov)
After discussion with Pierre Chambart, we convinced ourselves that the
tagged forms is what users will see in their debugger, and went for
0xBBBB / 2, which gets tagged as 0xBBBB.
Co-Authored-By: Pierre Chambart
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There is a naming conflict between using 'return v' to mean
- "build a piece of code that returns the same result as `v`", and
- the `return` function of the applicative functor
(Note that the first operation is not polymorphic: it has type
lambda -> lambda t
and not
'a -> 'a t
)
To avoid this ambiguity we rename our 'return' functions into
'lambda'.
(Issue spotted by Pierre Chambart during review.)
|
| | |
|
| |
| |
| |
| |
| |
| | |
Partial applications are obviously not considered TMC calls, but this
is also the case for direct calls to Tupled functions that do not take
a direct tuple literal, but another tuple value.
|
| |
| |
| |
| | |
We need to use this logic in lambda/tmc.ml to support tupled functions.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
One reason to error in these ambiguous situations, instead of making
a choice for the user, is that the TMC transformation changes the
evaluation order, delaying the call that is made tailrec to after the
evaluation of all other arguments.
Example:
```
type 'a tree =
| Leaf of 'a
| Node of 'a tree * 'a tree
let[@tail_mod_cons] rec correct_map f = function
| Leaf v -> Leaf (f v)
| Node (left, right) ->
Node (correct_map f left, (correct_map[@tailcall]) f right)
let[@tail_mod_cons] rec incorrect_map f = function
| Leaf v -> Leaf (f v)
| Node (left, right) ->
Node (incorrect_map f left, incorrect_map f right)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: [@tail_mod_cons]: this constructor application may be optimized in several different ways, please disambiguate by adding a [@tailcall] attribute to the call that should be made tail-recursive.
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The direct-style version of the tailmap3 function
let[@tail_mod_cons] rec tailmap3 = fun f li ->
match li with
| [] -> []
| x :: xs -> f 0 x :: f 1 x :: f 2 x :: tailmap3 f xs
looked as follows before this PR:
(tailmap3/109
(function f/110 li/111 tail_mod_cons
(if li/111
(let (xs/113 =a (field 1 li/111) x/112 =a (field 0 li/111))
(let (block/115 = (makemutable 0 (apply f/110 0 x/112) 0))
(seq
(let
(arg1/116 = (apply f/110 1 x/112)
block/117 = (makemutable 0 (apply f/110 2 x/112) 0))
(seq
(setfield_ptr(heap-init)_computed block/115 1
(makeblock 0 arg1/116 block/117))
(apply tailmap3_dps/114 block/117 1 f/110 xs/113)))
block/115)))
0a))
It now looks as follows:
(tailmap3/109
(function f/110 li/111 trmc
(if li/111
(let (xs/113 =a (field 1 li/111) x/112 =a (field 0 li/111))
(makeblock 0 (apply f/110 0 x/112)
(makeblock 0 (apply f/110 1 x/112)
(let (block/115 = (makemutable 0 (apply f/110 2 x/112) 0))
(seq (apply tailmap3_dps/114 block/115 1 f/110 xs/113)
block/115)))))
The idea is that the deeply nested constructor (f 2 x :: ...) needs
to be turned into a location for the tailmap3 call to go to the DPS
version, but the code around this constructor itself does not need
to be put in DPS form (as the constructor is already providing
a location). Advertising that it "does not benefit from DPS" let
us generate the much nicer version below, by not trying to create
new locations on each constructor above it.
|
| | |
|