[m-rev.] for post-commit review: requantify after inlining
Julien Fischer
jfischer at opturion.com
Fri Jun 21 14:22:27 AEST 2019
Hi Zoltan,
On Fri, 21 Jun 2019, Zoltan Somogyi wrote:
> For review by anyone. The attached DIFF.diet.c shows the effect of the change
> on diet.c.
>
> By the way, I got the idea for this change when I saw messages like this from
> the C# compiler:
>
> Mercury/css/diet.cs(386,25): warning CS0219: The variable `TypeInfo' is assigned but its value is never used
> diff --git a/compiler/inlining.m b/compiler/inlining.m
> index 64d0c9eaf..7fc3bd8db 100644
> --- a/compiler/inlining.m
> +++ b/compiler/inlining.m
...
> @@ -725,15 +718,15 @@ inline_in_proc(Params, ShouldInlineProcs, ShouldInlineTailProcs, PredProcId,
> InlinedParallel = no
> ),
>
> - (
> - Requantify = yes,
> - requantify_proc_general(ordinary_nonlocals_no_lambda, !ProcInfo)
> - ;
> - Requantify = no
> - ),
> -
> (
> DidInlining = yes,
> + % We want to requantify the procedure body if we did any inlining.
> + % If the body of the some inlined call did not use some of the
Delete the first "some".
> + % call's input arg vars, and this was the only use of the
> + % corresponding caller variables, this will tell the simplification
> + % pass we invoke before code generation that the goal(s) that
> + % generate those caller variables can be optimized away.
> + requantify_proc_general(ordinary_nonlocals_no_lambda, !ProcInfo),
> recompute_instmap_delta_proc(recompute_atomic_instmap_deltas,
Looks fine otherwise.
Julien.
More information about the reviews
mailing list