@@ -22,13 +22,15 @@ This is the compile-time entry point for DAECompiler code generation. It drives
2222"""
2323function factory_gen (world:: UInt , source:: Method , @nospecialize (_gen), settings, @nospecialize (fT))
2424 settings = settings. parameters[1 ]
25+ factory_mi = get_method_instance (Tuple{typeof (factory),Val{settings},typeof (fT)}, world)
26+ edges = Core. svec (factory_mi)
2527
2628 # First, perform ordinary type inference, under the assumption that we may need to AD
2729 # parts of the function later.
28- ci = ad_typeinf (world, Tuple{fT}; force_inline_all= settings. force_inline_all)
30+ ci = ad_typeinf (world, Tuple{fT}; force_inline_all= settings. force_inline_all, edges )
2931
3032 # Perform or lookup DAECompiler specific analysis for this system.
31- result = structural_analysis! (ci, world)
33+ result = structural_analysis! (ci, world, edges )
3234
3335 if isa (result, UncompilableIPOResult)
3436 return Base. generated_body_to_codeinfo (
@@ -42,19 +44,19 @@ function factory_gen(world::UInt, source::Method, @nospecialize(_gen), settings,
4244 (diff_key, init_key) = top_level_state_selection! (tstate)
4345
4446 if settings. mode in (DAE, DAENoInit, ODE, ODENoInit)
45- tearing_schedule! (tstate, ci, diff_key, world)
47+ tearing_schedule! (tstate, ci, diff_key, world, edges )
4648 end
4749 if settings. mode in (InitUncompress, DAE, ODE)
48- tearing_schedule! (tstate, ci, init_key, world)
50+ tearing_schedule! (tstate, ci, init_key, world, edges )
4951 end
5052
5153 # Generate the IR implementation of `factory`, returning the DAEFunction/ODEFunction
5254 if settings. mode in (DAE, DAENoInit)
53- ir_factory = dae_factory_gen (tstate, ci, diff_key, world, settings. mode == DAE ? init_key : nothing )
55+ ir_factory = dae_factory_gen (tstate, ci, diff_key, world, edges, settings. mode == DAE ? init_key : nothing )
5456 elseif settings. mode in (ODE, ODENoInit)
55- ir_factory = ode_factory_gen (tstate, ci, diff_key, world, settings. mode == ODE ? init_key : nothing )
57+ ir_factory = ode_factory_gen (tstate, ci, diff_key, world, edges, settings. mode == ODE ? init_key : nothing )
5658 elseif settings. mode == InitUncompress
57- ir_factory = init_uncompress_gen (result, ci, init_key, diff_key, world)
59+ ir_factory = init_uncompress_gen (result, ci, init_key, diff_key, world, edges )
5860 else
5961 return :(error (" Unknown generation mode: $(settings. mode) " ))
6062 end
0 commit comments