[m-rev.] diff: trail usage analysis

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Oct 27 18:42:50 AEST 2005


On Mon, 24 Oct 2005, Julien Fischer wrote:

> Some preliminary results with the trail usage analysis:
>
> library:
>
> will_not_modify_trail     :  409    (10.8%)
> conditional               :  625    (16.6%)
> may_modify_trail          : 2740    (72.6%)
> ---------------------
> Total procedures          : 3774
>
> compiler:
>
> will_not_modify_trail	  : 1740    (38.2%)
> conditional		  :   35    (0.8%)
> may_modify_trail 	  : 2779    (61.0%)
> --------------------
> Total procedures	  : 4556
>
> The above figures were obtained by grepping the .trans_opt files, so it's
> not all of the procedures in a program, just those that happen to be
> opt_exported.
>
> I would expected the percentages of `will_not_modify_trail' and `conditional'
> procedures to increase for the standard library since (a) the foreign_procs
> haven't yet been annotated with any trail usage information and (b) all of
> the procedure that have higher-order arguments are currently marked as
> `may_modify_trail'.

Annotating foreign procedures in the library raises the fraction of
procedures that can be detected not to modify the trail to about a
third, minus a bit for the library, plus a bit for the compiler.  (I
would expect that to rise a bit more with better support for
higher-order constructs.)

I've modified add_trail_ops.m so that it can use the information from the
trail usage analysis to avoid (some) redundant trailing.  For the hlc grades
we get the following results regarding the sizes of the mercury_compile and
mercury_profile executables.

hlc.gc	(--trans-intermode-opt)

	mercury_compile		9441056
	mercury_profile		1787856

hlc.gc.tr (--trans-intermod-opt)

	mercury_compile		10614888
	mercury_profile		2007864

hlc.gc.tr (--trans-intermod-opt --analyse-trail-usage)

	mercury_compile		10037544
	mercury_profile		1910712

hlc.gc	(--intermodule-optimizations)

	mercury_compile		9441056
	mercury_profile		1787856

hlc.gc.tr (--intermodule-optimization)

	mercury_compile		10614888
	mercury_profile		2007864

hlc.gc.tr (--intermodule-optimization --analyse-trail-usage)

	mercury_compile		10047400
	mercury_profile		1910712

All the above also had `--analyse-closures' enabled but that shouldn't won't
have made any diffrence since the trail usage analysis doesn't yet use any
information provided by closure analysis.  In addition to annotating the
foreign procs in the library the ones in the compiler were also annotated as
necessary.  Without using some form of intermodule optimization the space
savings drop to about 4 kilobytes.  The downside to all this is that the
increase in compilation time is pretty horrendous, particulary with transitive
intermodule optimization.

I'll run some timing benchmarks with the above compilers when I can get saturn
to myself for a couple of hours.  I'll also try modifying the lowlevel code
generator to see get any improvements in the LLDS grades.

Julien.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list