[m-rev.] for review: Re-factor the MR_join_and_continue macro.

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Nov 23 23:39:31 AEDT 2009

On 23-Nov-2009, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> compiler/par_conj_gen.m:
>     Modified the generation of the join and continue code.  This now includes
>     instructions for saving a pointer to the synchronization term into MR_r1,
>     before calling MR_join_and_continue.
>     Added an XXX: How to I tell the low-level backend that I will clobber MR_r1
>     and MR_succip?  Could someone familiar with the low-level backend help me?

That kind of problem is what I meant when I said that implementing this as a
call would be harder than fixing the macro.

You shouldn't have to clear other needed values of r1; you should have
*reserved* r1 earlier, before anything else gets put in it. Since you didn't,
you can move the value in r1 to a stack slot, using the predicates in
var_locn.m (which are well commented, and which are usually accessed through
their wrapper predicates in code_info.m), but since what you want is
effectively a call to a builtin predicate, you should instead either (a)
implement the call as a HLDS-to-HLDS transform in an earlier compiler pass,
or (b) use the infrastructure that already exists in call_gen.m to generate
the code for the call at code generation time. (a) seems to me to be

I haven't looked at the diff yet, since I have a really slow connection
and a small screen, but based on the misunderstanding above, I don't think
the diff is ready for review yet anyway.

mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au

More information about the reviews mailing list