Skip to content

Commit 9610244

Browse files
committed
misc fixes from looking at benchmark
1 parent 6e5d2a0 commit 9610244

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/transform/tearing/schedule.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function schedule_incidence!(compact, var_eq_matching, curval, incT::Incidence,
9797
continue
9898
end
9999
end
100-
\
100+
101101
acc = ir_mul_const!(compact, line, coeff, lin_var_ssa)
102102
curval = curval === nothing ? acc : ir_add!(compact, line, curval, acc)
103103
end
@@ -504,8 +504,8 @@ function matching_for_key(result::DAEIPOResult, key::TornCacheKey, structure = m
504504
may_use_eq(eq) = !(eq in explicit_eqs) && eqclassification(result, structure, eq) != External && eqkind(result, structure, eq) in (allow_init_eqs ? (Intrinsics.Initial, Intrinsics.Always) : (Intrinsics.Always,))
505505

506506
# Max match is the (unique) tearing result given the choice of states
507-
var_eq_matching = StateSelection.complete(StateSelection.maximal_matching(structure.graph, IPOMatches;
508-
dstfilter = may_use_var, srcfilter = may_use_eq), nsrcs(structure.graph))
507+
var_eq_matching = StateSelection.complete(StateSelection.maximal_matching(structure.solvable_graph, IPOMatches;
508+
dstfilter = may_use_var, srcfilter = may_use_eq), nsrcs(structure.solvable_graph))
509509

510510
if diff_states !== nothing
511511
for var in diff_states
@@ -677,7 +677,7 @@ function tearing_schedule!(state::TransformationState, ci::CodeInstance, key::To
677677

678678
for (callee_eq, caller_eq) in enumerate(info.mapping.eqs)
679679
if caller_eq in key.explicit_eqs
680-
push!(callee_explicit_eqs, callee_Eq)
680+
push!(callee_explicit_eqs, callee_eq)
681681
end
682682
end
683683

@@ -734,7 +734,7 @@ function tearing_schedule!(state::TransformationState, ci::CodeInstance, key::To
734734
end
735735
elseif stmt === nothing || isa(stmt, ReturnNode)
736736
continue
737-
elseif isexpr(stmt, :call)
737+
elseif isexpr(stmt, :call) || isexpr(stmt, :new) || isa(stmt, GotoNode)
738738
# TODO: Pull this up, if arguments are state-independent
739739
continue
740740
else
@@ -974,6 +974,7 @@ function tearing_schedule!(state::TransformationState, ci::CodeInstance, key::To
974974
if isa(var, Int)
975975
curval = nonlinearssa
976976
(curval, thiscoeff) = schedule_incidence!(compact1, var_eq_matching, curval, incT, var, line; vars=var_sols, schedule_missing_var!)
977+
@assert thiscoeff != nonlinear
977978
curval = ir_mul_const!(compact1, line, 1/thiscoeff, curval)
978979
var_sols[var] = curval
979980
insert_solved_var_here!(compact1, var, curval, line)

0 commit comments

Comments
 (0)