You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5595 Reporter:@alainfrisch Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2013-08-31T10:49:04Z) Resolution: fixed Priority: normal Severity: minor Category: back end (clambda to assembly) Monitored by:@jmeber
if n = 0 then c else Cop(Caddi, [c; Cconst_int n])
if n = 0 then c
else match c with
| Cconst_int x when no_overflow_add x n -> Cconst_int (x + n)
| c -> Cop(Caddi, [c; Cconst_int n])
let incr_int = function
Cconst_int n when n < max_int -> Cconst_int(n+1)
improves code generation, for instance for the following example:
===================================================================
let () =
let tr = Bigarray.(Array2.of_array int fortran_layout [| [|1|] |]) in
for i = 1 to 1000000000 do ignore tr.{1, 1} done
On my machine, runtime goes from 1.77s to 1.46s.
The text was updated successfully, but these errors were encountered:
Original bug ID: 5595
Reporter: @alainfrisch
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2013-08-31T10:49:04Z)
Resolution: fixed
Priority: normal
Severity: minor
Category: back end (clambda to assembly)
Monitored by: @jmeber
Bug description
The following patch:
===================================================================
--- asmcomp/cmmgen.ml (revision 12366)
+++ asmcomp/cmmgen.ml (working copy)
@@ -78,7 +78,10 @@
(Nativeint.add (Nativeint.shift_left (Nativeint.of_int n) 1) 1n)
let add_const c n =
let incr_int = function
Cconst_int n when n < max_int -> Cconst_int(n+1)
improves code generation, for instance for the following example:
===================================================================
let () =
let tr = Bigarray.(Array2.of_array int fortran_layout [| [|1|] |]) in
for i = 1 to 1000000000 do ignore tr.{1, 1} done
On my machine, runtime goes from 1.77s to 1.46s.
The text was updated successfully, but these errors were encountered: