[m-dev.] argument packing

Julien Fischer jfischer at opturion.com
Wed May 16 10:36:47 AEST 2018

Hi Zoltan,

On Tue, 15 May 2018, Zoltan Somogyi wrote:

> I committed the diff that enabled the packing of sub-word-sized
> integers and dummies in heap cells about a week ago. Have you
> guys tried out those features (after turning them on, since they are
> OFF by default)?
> The reason I ask is that traditionally, we computed the offset of each
> argument into the memory cell when we generated code for a unification.
> Since repeating this work for *every* unification is wasted work, that diff
> added code to compute these offsets just once, when the representation
> of each function symbol is decided, but it also left the old code in place,
> with assertions checking that the new method yields the exact same offset
> as the old method. I would like to delete the code that calculates the offsets
> the old way, along with the assertions, before I start work on my next
> diff involving argument packing. However, I would not want to take
> that step until those assertions have passed your toughest tests.

The first of those tougher tests would be compiling the standard
library in the csharp grade with the new optimizations turned on:

     Making Mercury/css/thread.mvar.cs
     Making Mercury/css/thread.semaphore.cs
     Making mer_std.dll
     ** Error making `mer_std.dll'.
     Mercury/css/erlang_rtti_implementation.cs(740,113): error CS0029: Cannot
     implicitly convert type `int' to `mercury.runtime.DuArgLocn'
     Mercury/css/erlang_rtti_implementation.cs(741,3): error CS0029: Cannot
     implicitly convert type `int' to `mercury.runtime.DuArgLocn'
    ... <more snipped>
     Mercury/css/erlang_rtti_implementation.cs(1445,30): error CS1729: The type
     does not contain a constructor that takes `0' arguments
     ... error log truncated, see `mer_std.err' for the complete log.
     gmake[1]: *** [libmer_std.install] Error 1

> So if you have compiled the Mercury programs you are working on
> with an installed compiler which has had its default values of
> allow_packing_ints and allow_packing_dummies set to `yes',
> and had those programs pass all their tests, please tell me.
> If you haven't, then please do so and tell me.
> And if you had any failures, please tell me as well.

I'll try a bunch of Opturion's stuff with the new optimizations enabled.
What's the best way to determine if the new optimizations have been


More information about the developers mailing list