mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 22:35:41 +00:00
Update the MLDS backend to handle structure reuse and compile time gc.
Estimated hours taken: 20
Update the MLDS backend to handle structure reuse and compile time gc.
Note that currently no pass on the main branch currently generates this
information yet.
mlds.m:
Add a new instruction delete_object which is to be inserted
whenever a lval can be compile time garbage collected.
ml_unify_gen.m:
Handle the case where the HowToConstruct field of a construction
is reuse_cell(_).
Handle the case where a deconstruction can be compile time gc'd.
hlds_goal.m:
Add a new field, can_cgc, to deconstruction unifications. This
field is `yes' if the deconstruction unification can be compile time
garbage collected.
hlds_out.m:
Output the can_cgc field. Output unification information if we
request the structure reuse information.
ml_elim_nested.m:
mlds_to_c.m:
Handle the delete_object instruction.
builtin_ops.m:
Fix a bug where body was an unary op instead of a binary op.
bytecode.m:
c_util.m:
llds.m:
opt_debug.m:
vn_cost.m:
Changes to reflect that body is a binary op.
bytecode_gen.m:
code_aux.m:
common.m:
cse_detection.m:
dependency_graph.m:
det_analysis.m:
goal_util.m:
higher_order.m:
mark_static_terms.m:
mode_util.m:
modecheck_unify.m:
pd_cost.m:
pd_util.m:
prog_rep.m:
rl_exprn.m:
rl_key.m:
simplify.m:
switch_detection.m:
term_traversal.m:
unify_gen.m:
unused_args.m:
Handle the can compile time gc field in deconstruction unifications.
This commit is contained in:
@@ -560,9 +560,10 @@ construct_common_unify(Var, GoalExpr0 - GoalInfo, Goal, Varset0, Varset,
|
||||
Typemap0, Typemap, Replacements) :-
|
||||
(
|
||||
GoalExpr0 = unify(_, Term, Umode, Unif0, Ucontext),
|
||||
Unif0 = deconstruct(_, Consid, Args, Submodes, CanFail)
|
||||
Unif0 = deconstruct(_, Consid, Args, Submodes, CanFail, CanCGC)
|
||||
->
|
||||
Unif = deconstruct(Var, Consid, Args, Submodes, CanFail),
|
||||
Unif = deconstruct(Var, Consid, Args,
|
||||
Submodes, CanFail, CanCGC),
|
||||
( Term = functor(_, _) ->
|
||||
GoalExpr1 = unify(Var, Term, Umode, Unif, Ucontext)
|
||||
;
|
||||
@@ -605,9 +606,9 @@ create_parallel_subterms([OFV | OFV0], Context, UnifyContext, Varset0, Varset,
|
||||
find_similar_deconstruct(OldUnifyGoal, NewUnifyGoal, Context, Replacements) :-
|
||||
(
|
||||
OldUnifyGoal = unify(_OT1, _OT2, _OM, OldUnifyInfo, OC) - _,
|
||||
OldUnifyInfo = deconstruct(_OV, OF, OFV, _OUM, _OCF),
|
||||
OldUnifyInfo = deconstruct(_OV, OF, OFV, _OUM, _OCF, _OCGC),
|
||||
NewUnifyGoal = unify(_NT1, _NT2, _NM, NewUnifyInfo, _NC) - _,
|
||||
NewUnifyInfo = deconstruct(_NV, NF, NFV, _NUM, _NCF)
|
||||
NewUnifyInfo = deconstruct(_NV, NF, NFV, _NUM, _NCF, _NCGC)
|
||||
->
|
||||
OF = NF,
|
||||
list__length(OFV, OFVC),
|
||||
|
||||
Reference in New Issue
Block a user