[m-dev.] [CTGC] conflict options ?

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Feb 1 02:12:29 AEDT 2006


On Wed, 1 Feb 2006, Julien Fischer wrote:

> Hi,
>
> I have a quite odd situation with the mercury options.
>
> I've added a new option "structure-sharing" (long option:
> data_structure_sharing_analysis) (cf. the attached options.m file).
> As structure sharing analysis depends on trans-opt files, it seems
> logical to me to add the line:
>
> option_implies(data_structure_sharing_analysis,
>       make_transitive_opt_interface, bool(yes), !Globals),
>
> in handle_options.m (see attach.).
>

This implication is incorrect.  The option
'make_transitive_opt_interface' tells the compiler to build the
.trans_opt file on this invocation and then stop.  It's not the same
as -c (--compile-to-c) which tells the compiler to generate code.

I suspect what you probably meant there was:

	option_implies(data_structure_sharing_analysis,
		transitive_optimization, bool(yes), !Globals)

but even that IMHO is unnecessary.  It should be possible to run the
structure sharing analysis without enabling transitive intermodule
optimization (it may not be very useful to do so, although in the case
of small test cases, like the one below, it means you can check things
are working just by compiling with -c).


> But here is the thing when I perform structure sharing analysis on a
> small example with the command line:
> "lmc -V -c -d 193 -D ALL --structure-sharing nrev.m"
>
> * without the above option_implies line, the analysis is performed,
> which can be seen in the output during compilation, and the hlds-dump.
> * but _with_ implication, the analysis is not done.
>

The reason that's happening is because --make-trans-opt is overriding
-c and it looks your analysis is only being run when compiling to C,
not when building the .trans_opt files.  In order to do the latter
you will need to modify mercury_compile.maybe_write_optfile/7 and
mercury_compile.output_trans_opt_file/5.  I suggest having a look
at how termination analysis is handled in mercury_compile.m since it
also uses transitive intermodule optimization.

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list