From: <fl...@us...> - 2012-02-25 04:13:09
|
Revision: 7561 http://mlton.svn.sourceforge.net/mlton/?rev=7561&view=rev Author: fluet Date: 2012-02-25 04:12:59 +0000 (Sat, 25 Feb 2012) Log Message: ----------- Fixed bug in redundant SSA optimization. Thanks to Lars Magnusson for the bug report and example. The redundant SSA optimization eliminates redundant function and label arguments; an argument of a function or label is redundant if it is always the same as another argument of the same function or label. The analysis finds an equivalence relation on the arguments of a function or label, such that all arguments in an equivalence class are redundant with respect to the other arguments in the equivalence class; the transformation selects one representative of each equivalence class and drops the binding occurrence of non-representative variables and renames use occurrences of the non-representative variables to the representative variable. The analysis finds the equivalence classes via a fixed-point analysis. Each vector of arguments to a function or label is initialized to equivalence classes that equate all arguments of the same type; one could start with an equivalence class that equates all arguments, but arguments of different type cannot be redundant. Variables bound in statements are initialized to singleton equivalence classes. The fixed-point analysis repeatedly refines these equivalence classes on the formals by the equivalence classes of the actuals. The original redundant SSA optimization used a representation of equivalence classes that was quadratic in the number of arguments to a function or label. This was acceptable until the development of a flattening optimization that would flatten tuples completely; such full flattening could increase the number of arguments to a function to > 3000: http://mlton.org/pipermail/mlton/2004-February/025131.html http://mlton.org/pipermail/mlton/2004-February/025133.html http://mlton.org/pipermail/mlton/2004-February/025137.html Two subsequent revisions of the redundant SSA optimization (r2929 and r2932) eliminated the quadratic implementation of equivalence classes and made performance improvements: http://mlton.svn.sourceforge.net/viewvc/mlton?view=revision&revision=2929 http://mlton.svn.sourceforge.net/viewvc/mlton?view=revision&revision=2932 http://mlton.org/pipermail/mlton/2004-March/025149.html Unfortunately, the second of these revisions introduced a bug whereby the analysis failed to terminate with the fixed point; instead, it could terminate with some non-redundant arguments left in the same equivalence class. The transformation would then eliminate a distinct argument to the function or label, changing the behavior of the program. It was not entirely clear how to fix the bug in the last version of the optimization (corresponding to the second of the above revisions, with only cosemetic revisions since). While reverting to the first of the above revisions eliminated the bug in the example program, there seemed to be some useful techniques in the second of the above revisions. This version of the optimization adopts a more transparently correct fixed-point analysis, but includes techniques that lead to fast convergence. The transparent correctness comes from accumulating a list of refinements due to the flow of actuals to formals and repeatedly applying all of the refinements until there are no changes to the equivalence classes. The fast convergence comes from discarding from the list of refinements any refinement where the formals have been refined to singleton equivalence classes; note that any function or label with zero or one argument necessarily has its formal in a singleton equivalence class, and need not be included in the initial refinement accumulation. In addition, it was observed that the "elements" field of Element.Class.t, which recorded the elements in the equivalence class, was unused. Eliminating this field led to a number of additional simplifications. This version correctly transforms the example program that demonstrated the bug in the last version; the example program has no opportunities for redundant argument elimination, but the analysis requires four iterations to converge to the fixed point. This version behaves identically to the last version on a self compile. A self-compile has 82 non-singleton equivalence classes and the largest non-singleton equivalence classes are 5 classes of 5 elements. The analysis requires five iterations to converge to the fixed point. The performance of this version is comparable to the last version. Revision Links: -------------- http://mlton.svn.sourceforge.net/mlton/?rev=2929&view=rev http://mlton.svn.sourceforge.net/mlton/?rev=2932&view=rev Modified Paths: -------------- mlton/trunk/doc/changelog mlton/trunk/mlton/ssa/redundant.fun This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <fl...@us...> - 2012-06-01 19:12:04
|
Revision: 7565 http://mlton.svn.sourceforge.net/mlton/?rev=7565&view=rev Author: fluet Date: 2012-06-01 19:11:55 +0000 (Fri, 01 Jun 2012) Log Message: ----------- Fixed bug in elaboration of type variables with and without equality status. Thanks to Rob Simmons for the bug report and examples. Fixed bug in elaboration that erroneously rejected the following: datatype ('a, ''a) t = T type ('a, ''a) u = unit and erroneously accepted the following: fun f (x: 'a) : ''a = x fun g (x: 'a) : ''a = if x = x then x else x Changed ast/tyvar.fun to record full name of type variable (including the '- or ''-prefix), which distinguishes the type variable 'a from the type variable ''a when compared with Tyvar.sameName. Thus, we now treat 'a, ''a, '''a, ... as distinct type variables (all but the first having equality status). Changed Tyvar.string, Tyvar.newString, and Tyvar.newNoname to accomodate new representation. Modified Paths: -------------- mlton/trunk/doc/changelog mlton/trunk/mlton/ast/tyvar.fun This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <fl...@us...> - 2012-06-11 20:57:49
|
Revision: 7573 http://mlton.svn.sourceforge.net/mlton/?rev=7573&view=rev Author: fluet Date: 2012-06-11 20:57:41 +0000 (Mon, 11 Jun 2012) Log Message: ----------- Use bit operations for real classification and low-level opeartions. Use Real{32,64}.cast{to,from}Word primitives for implementation of Real{32,64}.class and Real{32,64}.signBit. Real{32,64}.{to,from}Decimal should respect sign of nan values. Eliminates the need for C implementations of: IEEEReal.FloatClass.FP_{INFINITE,NAN,NORMAL,SUBNORMAL,ZERO} Real{32,64}.class (fpclassify) Real{32,64}.signBit (signbit) Real{32,64}.maxFinite Real{32,64}.minPos Real{32,64}.minNormalPos There is a minor inconsistency in the Standard ML Basis Library specification. IEEEReal.toString states: "If the sign field is true, a #"~" is prepended." This implies that a negative nan is converted to "~nan". IEEEReal.toString also states: "The composition toString o REAL.toDecimal is equivalent to REAL.fmt StringCvt.EXACT." However, REAL.{fmt,toString} states: "In all cases, ... NaN values are converted to the string "nan"." This implies that a negative nan is converted to "nan". This inconsistency is resolved in the implementation of the Basis Library by breaking the equivalence of "IEEEReal.toString o REAL.toDecimal" and "REAL.fmt StringCvt.EXACT" for the case of a negative nan. The former will return "~nan" (which is rationalized by the explicit sign field of the IEEEReal.decimal_approx type) and the latter will return "nan". Modified Paths: -------------- mlton/trunk/basis-library/primitive/basis-ffi.sml mlton/trunk/basis-library/primitive/check-real.sml mlton/trunk/basis-library/primitive/prim-real.sml mlton/trunk/basis-library/real/IEEE-real.sig mlton/trunk/basis-library/real/IEEE-real.sml mlton/trunk/basis-library/real/real.sig mlton/trunk/basis-library/real/real.sml mlton/trunk/runtime/basis/Real/IEEEReal-consts.c mlton/trunk/runtime/basis/Real/Real-consts.c mlton/trunk/runtime/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.def mlton/trunk/runtime/gen/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.sml mlton/trunk/runtime/platform/aix.c mlton/trunk/runtime/platform/aix.h mlton/trunk/runtime/platform/cygwin.h mlton/trunk/runtime/platform/darwin.h mlton/trunk/runtime/platform/freebsd.h mlton/trunk/runtime/platform/hpux.h mlton/trunk/runtime/platform/hurd.h mlton/trunk/runtime/platform/linux.h mlton/trunk/runtime/platform/mingw.h mlton/trunk/runtime/platform/netbsd.h mlton/trunk/runtime/platform/openbsd.h mlton/trunk/runtime/platform/solaris.c mlton/trunk/runtime/platform/solaris.h mlton/trunk/runtime/platform.h Removed Paths: ------------- mlton/trunk/runtime/basis/Real/class.c mlton/trunk/runtime/basis/Real/signBit.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <fl...@us...> - 2012-07-04 11:02:31
|
Revision: 7583 http://mlton.svn.sourceforge.net/mlton/?rev=7583&view=rev Author: fluet Date: 2012-07-04 11:02:27 +0000 (Wed, 04 Jul 2012) Log Message: ----------- Eliminate unused constant. On some platforms, FIONBIO is not 'int' (and, hence, generates a conversion warning). Modified Paths: -------------- mlton/trunk/basis-library/primitive/basis-ffi.sml mlton/trunk/runtime/basis/Net/Socket/Socket-consts.c mlton/trunk/runtime/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.def mlton/trunk/runtime/gen/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.sml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <fl...@us...> - 2012-07-04 11:07:32
|
Revision: 7611 http://mlton.svn.sourceforge.net/mlton/?rev=7611&view=rev Author: fluet Date: 2012-07-04 11:07:23 +0000 (Wed, 04 Jul 2012) Log Message: ----------- Direct implementation of Socket.Ctl.{getATMARK,getNREAD}. The 'ioctl' function is (very) platform dependent. The 'request' parameter may be 'int', 'unsigned int', 'unsigned long', etc., depending upon platform. Implementing Socket.Ctl.{getATMARK,getNREAD} via a direct 'ioctl' call avoids the need to fix a type for the request parameter in order to pass it through the FFI. Modified Paths: -------------- mlton/trunk/basis-library/net/socket.sig mlton/trunk/basis-library/net/socket.sml mlton/trunk/basis-library/primitive/basis-ffi.sml mlton/trunk/runtime/basis/Net/Socket/Socket-consts.c mlton/trunk/runtime/basis/Net/Socket/Socket.c mlton/trunk/runtime/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.def mlton/trunk/runtime/gen/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.sml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <fl...@us...> - 2012-07-04 11:07:55
|
Revision: 7612 http://mlton.svn.sourceforge.net/mlton/?rev=7612&view=rev Author: fluet Date: 2012-07-04 11:07:43 +0000 (Wed, 04 Jul 2012) Log Message: ----------- Simplify use of getsockopt and setsockopt. Seems much simpler to instantiate 'getsockopt' and 'setsockopt' at the two C-types at which they are used, rather than marshalling and unmarshalling in SML. Modified Paths: -------------- mlton/trunk/basis-library/net/net.sml mlton/trunk/basis-library/net/socket.sml mlton/trunk/basis-library/primitive/basis-ffi.sml mlton/trunk/runtime/basis/Net/Socket/Socket.c mlton/trunk/runtime/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.def mlton/trunk/runtime/gen/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.sml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <fl...@us...> - 2012-10-09 13:03:21
|
Revision: 7619 http://mlton.svn.sourceforge.net/mlton/?rev=7619&view=rev Author: fluet Date: 2012-10-09 13:03:07 +0000 (Tue, 09 Oct 2012) Log Message: ----------- Fixed bug in elaboration of strdescs in specs. Thanks to Bernard Berthomieu for the bug report and example. Fixed bug in elaboration that erroneously accepted the following: signature S = sig structure A : sig type t end and B : sig type t end where type t = A.t end The elaboration of a strdesc used a single Vector.foreach to elaborate each sigexp and to bind each strid (to the result of the elaborated sigexp); however, by binding each strid in the environment, the earlier strid-s were in scope for later sigexp-s. Changed the single Vector.foreach to a Vector.map to elaborate each sigexp followed by a Vector.foreach to bind each strid (to the result of the elaborated sigexp). Modified Paths: -------------- mlton/trunk/doc/changelog mlton/trunk/mlton/elaborate/elaborate-sigexp.fun This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |
From: <ter...@us...> - 2012-10-12 00:18:09
|
Revision: 7621 http://mlton.svn.sourceforge.net/mlton/?rev=7621&view=rev Author: terpstra Date: 2012-10-11 23:54:51 +0000 (Thu, 11 Oct 2012) Log Message: ----------- ARM processors do not support fe{set,get}round. They implement rounding modes as part of the instruction format, not a control register. This means that MLton's setRoundMode and withRoundingMode cannot work. However, ceil/trunc/floor/round can still work using the C library. This patch imports these methods and restructures real.sml to use them. It was also necessary to adjust how conversion limits are computed given the lack of a TO_ZERO rounding mode. This patch simply truncates the max value before it is (losslessly) converted to a real. Modified Paths: -------------- mlton/trunk/basis-library/primitive/basis-ffi.sml mlton/trunk/basis-library/primitive/prim-real.sml mlton/trunk/basis-library/real/real.sig mlton/trunk/basis-library/real/real.sml mlton/trunk/runtime/basis/Real/Math-fns.h mlton/trunk/runtime/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.def mlton/trunk/runtime/gen/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.sml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |