Commit Graph

258 Commits (7ad32890fe51263c719ece037707081a9e373186)

Author SHA1 Message Date
Pierre Chambart 575f20368d Avoid checking twice if divisor is zero (#702)
* Avoid checking twice if divisor is zero

The flambda branch before merging assumed that Pdivint and Pmodint where
already checked when entering Cmmgen. This was not the case anymore
after merging and this change was lost. This fix this overlook by adding
an annotation to the Pdivint and Pmodint primitive telling whether the
division by zero was already checked.

The reason to move the test generation to Closure_conversion in the
flambda branch was to allow the division primitive to be considered as
pure without needing to check for the effective value of the
divisor. This simplified Semantics_of_primitives a lot.

* Bigarray div and mod also carry safety information

* Handle bigint div and mod like int div and mod in closure_conversion

* Update Changes

* Test for divisions by zero

* Turn Pdivbint and Pmodbint argument into an inline record
2016-10-05 16:42:40 +02:00
Fabrice Le Fessant 6b436a43ea Add --reserved-header-bits XX to ./configure
with XX a number smaller than 32 (to leave at least 22 bits for the size)
2016-08-29 22:33:32 +02:00
Hongbo Zhang a36cd4c4ec add needed lambda IR for safe string 2016-08-07 11:07:10 -04:00
Damien Doligez 0b4fbc2b30 fix whitespace, long lines, headers 2016-08-01 16:06:59 +02:00
Mark Shinwell cd0bd8aa73 Spacetime: a new memory profiler (#585) 2016-07-29 15:07:10 +01:00
Gabriel Scherer e6c779ada8 Merge remote-tracking branch 'github-bobot/feature/reraise_raw_backtrace_primitive' into trunk
This restores the merge of #378 which had been previously reverted to
fix reraise support in some architectures:
  https://github.com/ocaml/ocaml/pull/378#issuecomment-235734005
2016-07-29 01:23:35 +02:00
Pierre Chambart 9acf4e22a6 Sort emitted functions 2016-07-28 19:12:16 +02:00
François Bobot bb4a1b4f5d Specialize raise_kind after cmmgen
since the semantic changed. There is no need to check Clflags.debug
   anymore Raise_withtrace, means that traces must be computed (if the
   runtime boolean is true).
2016-07-28 15:29:50 +02:00
François Bobot 7be0a81e9c Fix backtrace for regular raise on arm64, arm
for constant exception, a reraise was done
    instead of a raise
2016-07-28 13:46:23 +02:00
Damien Doligez d5a6e50ebe GPR#606: add unboxed types 2016-07-21 13:51:46 +02:00
Mark Shinwell c843ca0691 Labels after calls, call GC points and checkbound points (again) (#660) 2016-07-06 11:44:00 +01:00
Alain Frisch c3c523109e Revert "Labels after calls, call GC points and checkbound points" 2016-07-01 18:42:51 +02:00
Mark Shinwell 432f87f077 Labels after calls, call GC points and checkbound points (#644) 2016-07-01 15:16:03 +01:00
Mark Shinwell 1d3a6c3038 Rename Cconst_blockheader to Cblockheader (#642) 2016-06-30 07:46:45 +01:00
Mark Shinwell ca03b4e500 Decorate more Cmm terms with location information (#627) 2016-06-27 08:49:26 +01:00
alainfrisch 2d927bd8d5 Merge branch 'bb_sys_backend_type' of https://github.com/bloomberg/ocaml into bloomberg-bb_sys_backend_type 2016-05-02 18:12:38 +02:00
alainfrisch a4142e3d82 Do not unbox immutable let-bindings when this cannot eliminate allocations
Previously, a let-binding such as:

  let x =
    if ... then 0. else ...
  in
  ...

would keep x in unboxed form, which is mostly useless (it can avoid
multiple memory loads but no allocation) and possibly harmful (it
can result in more allocations on use sites).
2016-04-29 15:35:46 +02:00
Hongbo Zhang 31c88ac4d9 always use tag 0 to make it consistent 2016-04-27 21:03:55 -04:00
Hongbo Zhang 6c3a01bb7c prepare backend_type primitive 2016-04-24 17:42:23 -04:00
Mark Shinwell b2e7162546 Second attempt at fixing GPR#167 fallout 2016-04-15 13:41:54 +01:00
Mark Shinwell e26cd12701 Fix for GPR#167 2016-04-14 16:29:57 +01:00
Pierre Chambart 3ad95a3a59 Also record type information for int 2016-04-12 14:49:54 +02:00
Pierre Chambart 211e6f54fb Use the mutable_flag instead of let_kind for clambda let 2016-04-12 14:49:53 +02:00
alainfrisch 83ae23568c Renaming block_kind -> value_kind. 2016-04-12 14:49:50 +02:00
alainfrisch 4dab0b8924 Doc. 2016-04-12 14:49:45 +02:00
alainfrisch 258a335791 When deciding whether to unbox a let binding, if one knows statically that the type of the bound expression is an unboxed number, relax the criterion: unbox if this benefits to at least one branch of the bound expression (instead of checking all branches). 2016-04-12 14:49:44 +02:00
alainfrisch 9b7e5868f2 Detect all let-bindings to unboxable floats. 2016-04-12 14:49:43 +02:00
alainfrisch c996f5f18d Keep track of mutable variables obtained by eliminating local references holding aun unboxable number type. Then force unboxing of such variables to avoid repeated boxing every time the reference is assigned. 2016-04-12 14:49:40 +02:00
Pierre Chambart 2923d4d294 Make Cmmgen understand constant bools 2016-03-31 15:32:33 +02:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
alainfrisch 8d0f08b20e Fix a probable non-bug.
Commit 39760599e5 introduced some bogus logic.
Emitting structured constants can register more closures to be emitted.  But either
the name of these closures is "unique enough", in which case we don't need the already_translated
argument in transl_all_functions_and_emit_all_constants (and transl_all_functions does not need
to return the set of already emitted functions).  Or this is not the case, and the previous code
was wrong since it forgot to remember the set returned by transl_all_functions.

I've fixed the code assuming the latter in order to be on the safe side, but we would probably have
noticed if the former assumption did not hold.  I've added a note to the commit mentioned above
so that @chambart can have a look at it.
2016-03-09 13:41:13 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Mark Shinwell bde2bdd206 Reformatting only (to the standards of tools/check-typo) 2016-02-10 18:28:38 +01:00
Mark Shinwell 355cf1d40b merge 2016-01-29 14:43:38 +00:00
Pierre Chambart b0b0f6609c Enable flambda 2016-01-28 15:04:47 +01:00
Pierre Chambart 93956dc1ef Avoid pushing test deep inside conditions 2016-01-22 09:36:59 +01:00
Mark Shinwell 20d1951566 Merge pull request #417 from chambart/flambda_prereq-duparray_and_array_mutability
GPR#417: Add explicit duplication of literal arrays
2016-01-21 16:05:44 +00:00
Mark Shinwell d489fd2038 comments 2016-01-15 14:54:33 +00:00
Mark Shinwell 0664a1cf03 Alter array patch after feedback from jdimino 2016-01-15 14:49:01 +00:00
Damien Doligez d296864174 remove unused (and wrong?) line in cmmgen.ml 2016-01-15 15:25:23 +01:00
Mark Shinwell 9fd67a6052 if-then-else changes in Cmmgen 2016-01-15 11:56:02 +00:00
Mark Shinwell 8e9c865176 Improved fatal error messages in Cmmgen 2016-01-15 11:53:50 +00:00
Mark Shinwell fb312a989c Minor naming/comment changes in Cmmgen 2016-01-15 11:20:03 +00:00
Mark Shinwell 5548d4e3ed Merge remote-tracking branch 'ocaml/trunk' into flambda_prereq-popaque 2016-01-14 16:47:31 +00:00
Mark Shinwell 0000ac57ab turn bool into not_global 2016-01-14 15:16:15 +00:00
Pierre Chambart 8ef3c0a52f Cmmgen.emit_structured_constant emit Cglobal_symbol 2016-01-13 18:44:20 +01:00
Pierre Chambart 581b2bc020 Add Clambda.preallocated_{block, constants} types
And accept them as argument of Cmmgen.compunit
2016-01-13 18:23:02 +01:00
Pierre Chambart 354bd48f20 Prim makearray 2016-01-12 19:51:06 +01:00
Pierre Chambart 9c60ae1692 Add the opaque primitive 2016-01-12 19:24:22 +01:00
Mark Shinwell 74b8b6ab5e Merge pull request #360 from mshinwell/flambda_prereq-init_assign
GPR#360: Propagate whether or not stores are initializing, etc.
2016-01-12 18:18:27 +01:00