summaryrefslogtreecommitdiff
path: root/lambda
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #11587 from lthls/poly-variant-pointer-comparisonGabriel Scherer2022-10-041-3/+8
|\ | | | | Stop using integer comparison on potential pointers
| * ReviewVincent Laviron2022-10-021-9/+8
| |
| * Stop using integer comparison on potential pointersVincent Laviron2022-09-301-2/+8
| |
* | Manual chapters on parallelism and memory model (#11280)KC Sivaramakrishnan2022-10-041-1/+1
|/ | | Add manual chapters on parallelism and memory model
* lambda/switch.ml: fix typoIkko Ashimine2022-08-241-1/+1
| | | paramter -> parameter
* Improve the location reported by parenthesized assertions (#10852)Fabian2022-07-251-6/+5
| | | | | Extend the typedtree with a location field for assertions, which is taken from the location stack of the parsetree.
* lambda/switch.ml: document some internal typesGabriel Scherer2022-07-211-5/+69
|
* lambda/switch.ml: documentation commentsGabriel Scherer2022-07-201-18/+26
|
* [refactoring] lambda/switch.ml: remove unused debug parameterGabriel Scherer2022-07-201-21/+19
|
* [refactor] lambda/switch.ml: constant namesGabriel Scherer2022-07-201-9/+9
|
* lambda/switch.ml: document the algorithmGabriel Scherer2022-07-201-11/+66
|
* minor simplification in lambda/switch.mlGabriel Scherer2022-07-191-15/+9
| | | | | | | | | | | | | | | 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.
* add -safer-matching flag to disable type-based optimization of pattern-matchingJacques Garrigue2022-07-191-2/+2
|
* Fix composition of coercions with aliases (#11188)Vincent Laviron2022-06-271-7/+12
| | | | | | | * Fix composition of coercions with aliases * Changes * Add test
* Remove uses of ;; from the codebaseSébastien Hinderer2022-02-255-7/+3
|
* Ensure that build_apply respects Lambda.max_arityStephen Dolan2022-02-121-1/+2
|
* Make Lambda.lfunction privateStephen Dolan2022-02-129-118/+135
|
* Merge pull request #11000 from gasche/translattribute-fixSadiq Jaffer2022-02-101-0/+1
| | | | | | fix a minor regression from #10462 (cherry picked from commit c8c51a735d3cd4695892012f5aaab103b6a6cacf)
* Remove configuration options --disable-force-safe-string and ↵Kate2022-02-012-3/+3
| | | | | 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.
* Review: reference pull requestsVincent Laviron2022-01-161-2/+2
|
* Bring back and update comment on CamlinternalLazy.force_genVincent Laviron2022-01-161-3/+5
|
* Move opaque wrapper to compiler-generated codeVincent Laviron2022-01-161-30/+17
|
* Merge commit 'b4c5d7a55d9ec25693ba741a613d81f2c3ef66bc' into 5.00_rebase_to_prTom Kelly2021-12-211-8/+1
|\
| * Revert "Restore optim for objects directly under a top-level module"Alain Frisch2021-11-151-7/+0
| | | | | | | | This reverts commit efb4a8d5cf0bb77fb8bba41e1d76172af7f78162.
| * Restore optim for objects directly under a top-level moduleAlain Frisch2021-11-101-0/+7
| |
| * Fix #10763 (miscompilation of method delegation)Alain Frisch2021-11-101-8/+1
| |
* | Merge commit 'edf0075888ec27a50c4f50f76dba46f730797651' into 5.00_rebase_to_prTom Kelly2021-12-205-3/+84
|\ \ | |/
| * Add [@poll error] attribute (#10462)Sadiq Jaffer2021-11-095-3/+84
| |
* | Merge commit '2bcef4bc172f476217f253d24cb3311eaca504bf' into 5.00_rebase_to_prTom Kelly2021-12-208-25/+1171
|\ \ | |/
| * bow to check-typoGabriel Scherer2021-11-022-29/+42
| |
| * [minor] complete the renaming of 'TRMC' into 'TMC'Gabriel Scherer2021-11-021-1/+1
| | | | | | | | (suggestion from Konstantin Romanov)
| * [review] move the main TMC comment to tmc.mliGabriel Scherer2021-11-022-56/+55
| |
| * [review] improve code readability within TMC disambiguationGabriel Scherer2021-11-021-4/+4
| |
| * TMC: much thinking about which @tailcall annotations to preserve whereGabriel Scherer2021-11-021-16/+32
| | | | | | | | Co-Authored-By: Pierre Chambart
| * [review]: in TMC ambiguity errors, print the ambiguous callsitesGabriel Scherer2021-11-021-40/+106
| |
| * [review] copyright headers and .mli fileGabriel Scherer2021-11-022-0/+43
| |
| * TMC: do not warn on ambiguous sub-terms of non-ambiguous programsGabriel Scherer2021-11-021-4/+45
| |
| * TMC: implement [@tail_mod_cons] for non-recursive letsGabriel Scherer2021-11-021-9/+22
| |
| * [review] TMC: make 'offset' distinct from 'lambda' for clarityGabriel Scherer2021-11-021-12/+14
| |
| * [review] tmc: use a placeholder value that is better for debuggingGabriel Scherer2021-11-021-2/+4
| | | | | | | | | | | | | | | | | | | | (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
| * [review] interface for Tmc.ConstrGabriel Scherer2021-11-021-29/+53
| |
| * [review] TMC: rename 'return' to 'lambda'Gabriel Scherer2021-11-021-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
| * [review] rename 'con' into 'constr'Gabriel Scherer2021-11-021-21/+26
| |
| * TMC: support Tupled functions and partial applicationsGabriel Scherer2021-11-021-3/+21
| | | | | | | | | | | | 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.
| * [refactoring] move Simplif.exact_application to LambdaGabriel Scherer2021-11-023-17/+22
| | | | | | | | We need to use this logic in lambda/tmc.ml to support tupled functions.
| * TMC: warn when a tail-call is broken by the TMC transformation.Gabriel Scherer2021-11-021-37/+36
| |
| * TMC: warn if there is no optimization opportunityGabriel Scherer2021-11-021-0/+4
| |
| * TMC: error if several different calls could be optimizedGabriel Scherer2021-11-021-25/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ```
| * TMC: Constructor composition in direct style: [benefits_from_dps : bool].Gabriel Scherer2021-11-021-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * TMC: [minor] improve dummy name generation for let-bound argumentsGabriel Scherer2021-11-021-7/+10
| |