[m-rev.] for review: reserved address tag test optimization

Tyson Dowd trd at cs.mu.OZ.AU
Mon Nov 5 12:42:47 AEDT 2001


On 01-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Branches: main
> Estimated hours taken: 4
> 
> Avoid some unnecessary tag tests when using reserved address
> data representations.
> 
> compiler/hlds_data.m:
> 	Add new cons_tag alternative `single_functor'.
> 	This is equivalent to `unshared_tag(0)' except that it
> 	also means that there are no other primary tag values used.
> 
> 	Previously this wasn't needed, since any tag tests
> 	against `unshared_tag(0)' would be marked as `cannot_fail'
> 	by determinism analysis.  However, now that we have
> 	reserved addresses, that is not sufficient: a tag test against 
> 	`shared_with_reserved_address(null_pointer, unshared_tag(0))'
> 	is semidet, because it needs to first check for null,
> 	but if there are no other functors then it should NOT
> 	bother to check that the tag is zero.  We need the
> 	`single_functor' alternative to optimize that case.
> 
> compiler/make_tags.m:
> 	Assign `single_functor' representations rather than
> 	`unshared_tag(0)' if there are no other functors remaining.
> 
> compiler/ml_unify_gen.m:
> compiler/unify_gen.m:
> 	Optimize away the tag test for `single_functor' alternatives.
> 
> compiler/bytecode_gen.m:
> compiler/hlds_data.m:
> compiler/type_ctor_info.m:
> compiler/switch_util.m:
> compiler/ml_unify_gen.m:
> compiler/unify_gen.m:
> 	Minor changes to handle the new cons_tag alternative:
> 	treat it the same as `unshared_tag(0)'.
> 
> compiler/code_util.m:
> compiler/unify_proc.m:
> 	Use `single_functor' rather than `unshared_tag(0)' for tuples.
> 
> compiler/ml_code_util.m:
> 	Add ml_gen_and and ml_gen_not, for use by compiler/ml_unify_gen.m.
> 

This change seems fine, thanks.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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