[m-dev.] remembering goal variables

Peter Wang novalazy at gmail.com
Mon Sep 17 12:12:50 AEST 2007


I'm trying to solve a performance problem in the MLDS code generator
when compiling deeply nested code, like:

    (C1 -> T1 ; (C2 -> T2 ; (C3 -> T3 ; ... )))

The problem is that ml_code_gen.m calls goal_local_vars, which calls
goal_util.goal_vars.  As the ite is generated the goal vars of the else
branches are repeatedly being recomputed.  My solution is to calculate
the goal vars once and store them in the goal info, by adding an
mlds_code_gen_info functor to the hlds_goal_code_gen_info type.

Does that sound about right?  Other ideas?


mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au

More information about the developers mailing list