Skip to content

Commit 8ba69ae

Browse files
authored
Fix invalidations from new == method (#456)
``` julia> tree inserting ==(retcode::SciMLBase.ReturnCode.T, s::Symbol) @ SciMLBase ~/.julia/packages/SciMLBase/QqtZA/src/retcodes.jl:348 invalidated: mt_backedges: 1: signature ==(x, y) @ Base Base.jl:127 (formerly ==(x, y) @ Base Base.jl:127) triggered MethodInstance for MacroTools.store!(::Dict{Any, Any}, ::Symbol, ::Symbol) (3 children) 2: signature ==(x, y) @ Base Base.jl:127 (formerly ==(x, y) @ Base Base.jl:127) triggered MethodInstance for isequal(::Any, ::Symbol) (1 children) backedges: 1: superseding ==(x, y) @ Base Base.jl:127 with MethodInstance for ==(::Any, ::Symbol) (224 children) 2 mt_cache ``` The plurality of those invalidations are LoopVectorization-related.
1 parent c3dbca5 commit 8ba69ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/constructors.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ function replace_enumerate!(q, prepreamble)
201201
end
202202
function replace_single_enumerate!(q, prepreamble, i = nothing)
203203
if isnothing(i) # not nest loop
204-
looprange, body = q.args[1], q.args[2]
204+
looprange, body = q.args[1]::Expr, q.args[2]
205205
else # nest loop
206-
looprange, body = q.args[1].args[i], q.args[2]
206+
looprange, body = q.args[1].args[i]::Expr, q.args[2]
207207
end
208208
@assert Meta.isexpr(looprange, :(=), 2)
209209
itersyms, r = looprange.args
210-
if Meta.isexpr(r, :call, 2) && r.args[1] == :enumerate
210+
if Meta.isexpr(r, :call, 2) && r.args[1] === :enumerate
211211
_iter = r.args[2]
212212
if _iter isa Symbol
213213
iter = _iter

src/modeling/graphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ function instruction!(ls::LoopSet, x::Expr)
12771277
end
12781278
# if x.head ≢ :(->)
12791279
instr = last(x.args).value
1280-
instr keys(COST) && return Instruction(:LoopVectorization, instr)
1280+
isa(instr, Symbol) && instr keys(COST) && return Instruction(:LoopVectorization, instr)
12811281
# end
12821282
instr = gensym!(ls, "f")
12831283
pushprepreamble!(ls, Expr(:(=), instr, x))

0 commit comments

Comments
 (0)