[m-rev.] for review: use var_tables in several later compiler passes

Julien Fischer jfischer at opturion.com
Sun Apr 17 13:35:34 AEST 2022


On Sat, 16 Apr 2022, Zoltan Somogyi wrote:


> Use var_tables in more of the later passes.
> 
> compiler/add_heap_ops.m:
> compiler/add_trail_ops.m:
> compiler/float_regs.m:
> compiler/lambda.m:
> compiler/mark_tail_calls.m:
>     Convert these passes to use var_tables instead of varsets and vartypes.

...

> diff --git a/compiler/inlining.m b/compiler/inlining.m
> index 4f95bf625..6c6ce75ae 100644
> --- a/compiler/inlining.m
> +++ b/compiler/inlining.m

> @@ -937,15 +938,23 @@ inlining_in_call(GoalExpr0, GoalInfo0, Goal, !Info) :-
>          ),
>
>          Goal1 = hlds_goal(_, GoalInfo1),
> -        % If the inferred determinism of the called goal differs from the
> -        % declared determinism, flag that we should rerun determinism analysis
> -        % on this proc.
> +        % If the determinism of the call is the same as the determinism
> +        % of the callee (which it should be, unless something has changed
> +        % either since determinism analysis) *and* all the argument variables

Delete "either".


> +        % are used outside the call, then there is no need to rerun
> +        % determinism analysis. If *do* have to rerun it if we have not met

s/If/We/

> +        % one of the above preconditions.
>          Determinism0 = goal_info_get_determinism(GoalInfo0),
>          Determinism1 = goal_info_get_determinism(GoalInfo1),
> -        ( if Determinism0 = Determinism1 then
> +        ArgVarSet = set_of_var.list_to_set(ArgVars),
> +        NonLocals = goal_info_get_nonlocals(GoalInfo0),
> +        ( if
> +            Determinism0 = Determinism1,
> +            set_of_var.subset(ArgVarSet, NonLocals)
> +        then


That looks fine otherwise.

Julien.


More information about the reviews mailing list