Ok. I found two problems with the @threads
implementation: Types for variables C
and range
are not inferred (not sure where range
is used, as it’s not defined by me. I guess it’s the range over which a for
loops?). This is the output of @code_warntype
.
Variables:
#self# <optimized out>
X::Array{Float64,2}
no_objects::Int64
no_dims::Int64
no_triplets::Int64
triplets::Array{Int64,2}
λ::Float64
α::Float64
i@_9::Int64
#temp#@_10::Int64
k@_11::Int64
#temp#@_12::Int64
k@_13::Int64
#temp#@_14::Int64
i@_15::Int64
#temp#@_16::Int64
j::Int64
#temp#@_18::Int64
n::Int64
#temp#@_20::Int64
i@_21::Int64
#temp#@_22::Int64
#5@_23 <optimized out>
P::Array{Float64,1}
C@_25::Core.Box
∇C::Array{Float64,2}
sum_X::Array{Float64,1}
K::Array{Float64,2}
Q::Array{Float64,2}
A_to_B::Array{Float64,1}
A_to_C::Array{Float64,1}
constant::Float64
triplets_A::Array{Int64,1}
triplets_B::Array{Int64,1}
triplets_C::Array{Int64,1}
range::Core.Box
threadsfor_fun::Embeddings.##122#threadsfor_fun#7{Array{Float64,2},Int64,Array{Int64,2},Array{Float64,1},Array{Float64,2},Array{Float64,2},Array{Float64,2},Array{Float64,1},Array{Float64,1},Float64,Array{Int64,1},Array{Int64,1},Array{Int64,1}}
#temp#@_38::Bool
T <optimized out>
shape <optimized out>
iter <optimized out>
C@_42::Array{Float64,2}
keeps@_43::Tuple{Tuple{Bool,Bool}}
Idefaults@_44::Tuple{Tuple{Int64,Int64}}
#temp#@_45 <optimized out>
keeps@_46 <optimized out>
Idefaults@_47 <optimized out>
#temp#@_48 <optimized out>
keep@_49::Tuple{Bool,Bool}
Idefault@_50::Tuple{Int64,Int64}
#temp#@_51 <optimized out>
ind1@_52 <optimized out>
keep@_53::Tuple{Bool}
Idefault@_54::Tuple{Int64}
#temp#@_55 <optimized out>
ind1@_56 <optimized out>
keep@_57 <optimized out>
Idefault@_58 <optimized out>
#temp#@_59 <optimized out>
I_1 <optimized out>
val_1::Float64
result::Float64
I@_63 <optimized out>
i#724::Int64
I@_65 <optimized out>
n#723::Int64
i#722 <optimized out>
#temp#@_68::CartesianIndex{1}
r#721 <optimized out>
A_1 <optimized out>
keep_1::Tuple{Bool,Bool}
Idefault_1::Tuple{Int64,Int64}
start::CartesianIndex{1}
stop <optimized out>
#5@_75 <optimized out>
#temp#@_76::CartesianIndex{1}
#temp#@_77 <optimized out>
#temp#@_78::Float64
#temp#@_79::Float64
Body:
begin
C@_25::Core.Box = $(Expr(:new, :(Core.Box)))
range::Core.Box = $(Expr(:new, :(Core.Box)))
NewvarNode(:(threadsfor_fun::Embeddings.##122#threadsfor_fun#7{Array{Float64,2},Int64,Array{Int64,2},Array{Float64,1},Array{Float64,2},Array{Float64,2},Array{Float64,2},Array{Float64,1},Array{Float64,1},Float64,Array{Int64,1},Array{Int64,1},Array{Int64,1}}))
SSAValue(0) = Tuple{Float64,Array{Float64,2}}
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl nthreads 19
SSAValue(32) = (Base.Threads.cglobal)(:jl_n_threads, Base.Threads.Cint)::Ptr{Int32}
SSAValue(33) = (Base.pointerref)(SSAValue(32), 1, 1)::Int32
# meta: pop location
$(Expr(:inbounds, :pop))
P::Array{Float64,1} = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Float64,1}, svec(Any, Int64), Array{Float64,1}, 0, :((Base.sext_int)(Int64, SSAValue(33))::Int64), 0)) # line 127:
$(Expr(:inbounds, false))
# meta: location broadcast.jl broadcast 455
# meta: location broadcast.jl broadcast_c 313
# meta: location broadcast.jl broadcast_indices 48
# meta: location broadcast.jl broadcast_indices 52
# meta: location abstractarray.jl indices 64
SSAValue(38) = (Base.arraysize)(X::Array{Float64,2}, 1)::Int64
SSAValue(39) = (Base.arraysize)(X::Array{Float64,2}, 2)::Int64
# meta: pop location
# meta: pop location
# meta: pop location
SSAValue(128) = (Base.select_value)((Base.slt_int)(SSAValue(38), 0)::Bool, 0, SSAValue(38))::Int64
SSAValue(129) = (Base.select_value)((Base.slt_int)(SSAValue(39), 0)::Bool, 0, SSAValue(39))::Int64 # line 316:
# meta: location broadcast.jl broadcast_t 268
C@_42::Array{Float64,2} = $(Expr(:foreigncall, :(:jl_alloc_array_2d), Array{Float64,2}, svec(Any, Int64, Int64), Array{Float64,2}, 0, SSAValue(128), 0, SSAValue(129), 0)) # line 269:
# meta: location broadcast.jl map_newindexer 125 # line 126:
# meta: location broadcast.jl newindexer 108
# meta: location broadcast.jl broadcast_indices 48
# meta: location broadcast.jl broadcast_indices 52
# meta: location abstractarray.jl indices 64
SSAValue(57) = (Base.arraysize)(X::Array{Float64,2}, 1)::Int64
SSAValue(58) = (Base.arraysize)(X::Array{Float64,2}, 2)::Int64
# meta: pop location
# meta: pop location
# meta: pop location
SSAValue(80) = (Base.select_value)((Base.slt_int)(SSAValue(57), 0)::Bool, 0, SSAValue(57))::Int64
SSAValue(81) = (Base.select_value)((Base.slt_int)(SSAValue(58), 0)::Bool, 0, SSAValue(58))::Int64
# meta: location broadcast.jl shapeindexer 111 # line 112:
SSAValue(70) = (Core.tuple)((Base.and_int)((Base.and_int)((1 === 1)::Bool, (1 === 1)::Bool)::Bool, (SSAValue(129) === SSAValue(81))::Bool)::Bool)::Tuple{Bool}
SSAValue(71) = (Core.tuple)(1)::Tuple{Int64}
keep@_53::Tuple{Bool} = SSAValue(70)
Idefault@_54::Tuple{Int64} = SSAValue(71)
# meta: pop location
# meta: pop location
SSAValue(82) = (Core.tuple)((Base.and_int)((Base.and_int)((1 === 1)::Bool, (1 === 1)::Bool)::Bool, (SSAValue(128) === SSAValue(80))::Bool)::Bool, (Core.getfield)(keep@_53::Tuple{Bool}, 1)::Bool)::Tuple{Bool,Bool}
SSAValue(83) = (Core.tuple)(1, (Core.getfield)(Idefault@_54::Tuple{Int64}, 1)::Int64)::Tuple{Int64,Int64}
keep@_49::Tuple{Bool,Bool} = SSAValue(82)
Idefault@_50::Tuple{Int64,Int64} = SSAValue(83)
# meta: pop location
SSAValue(119) = (Core.tuple)(keep@_49::Tuple{Bool,Bool})::Tuple{Tuple{Bool,Bool}}
SSAValue(120) = (Core.tuple)(Idefault@_50::Tuple{Int64,Int64})::Tuple{Tuple{Int64,Int64}}
keeps@_43::Tuple{Tuple{Bool,Bool}} = SSAValue(119)
Idefaults@_44::Tuple{Tuple{Int64,Int64}} = SSAValue(120) # line 270:
# meta: location broadcast.jl _broadcast! 141
# meta: location broadcast.jl # line 147:
keep_1::Tuple{Bool,Bool} = (Base.getfield)(keeps@_43::Tuple{Tuple{Bool,Bool}}, 1)::Tuple{Bool,Bool} # line 148:
Idefault_1::Tuple{Int64,Int64} = (Base.getfield)(Idefaults@_44::Tuple{Tuple{Int64,Int64}}, 1)::Tuple{Int64,Int64} # line 149:
# meta: location simdloop.jl # line 66:
# meta: location multidimensional.jl simd_outer_range 246
start::CartesianIndex{1} = $(Expr(:new, CartesianIndex{1}, :((Core.tuple)(1)::Tuple{Int64})))
# meta: pop location
# meta: location multidimensional.jl start 206
unless (Base.slt_int)(SSAValue(129), (Base.getfield)((Core.getfield)(start::CartesianIndex{1}, :I)::Tuple{Int64}, 1)::Int64)::Bool goto 81 # line 207:
# meta: location multidimensional.jl + 111
SSAValue(92) = (Core.tuple)((Base.add_int)(SSAValue(129), 1)::Int64)::Tuple{Int64}
# meta: pop location
#temp#@_76::CartesianIndex{1} = $(Expr(:new, CartesianIndex{1}, SSAValue(92)))
goto 84
81: # line 209:
#temp#@_76::CartesianIndex{1} = start::CartesianIndex{1}
84:
# meta: pop location
#temp#@_68::CartesianIndex{1} = #temp#@_76::CartesianIndex{1}
87:
# meta: location multidimensional.jl done 224
SSAValue(94) = (Core.getfield)(#temp#@_68::CartesianIndex{1}, :I)::Tuple{Int64}
SSAValue(95) = (Base.getfield)(SSAValue(94), 1)::Int64
# meta: pop location
unless (Base.not_int)((Base.slt_int)(SSAValue(129), SSAValue(95))::Bool)::Bool goto 138
SSAValue(113) = #temp#@_68::CartesianIndex{1}
SSAValue(114) = $(Expr(:new, CartesianIndex{1}, :((Core.tuple)((Base.add_int)((Base.getfield)((Core.getfield)(#temp#@_68, :I)::Tuple{Int64}, 1)::Int64, 1)::Int64)::Tuple{Int64})))
#temp#@_68::CartesianIndex{1} = SSAValue(114) # line 67:
n#723::Int64 = (Base.add_int)((Base.sub_int)(SSAValue(128), 1)::Int64, 1)::Int64 # line 68:
unless (Base.slt_int)(0, n#723::Int64)::Bool goto 136 # line 70:
i#724::Int64 = 0 # line 71:
NewvarNode(:(val_1::Float64))
NewvarNode(:(result::Float64))
105:
unless (Base.slt_int)(i#724::Int64, n#723::Int64)::Bool goto 134 # line 72:
SSAValue(124) = (Base.add_int)(i#724::Int64, 1)::Int64
SSAValue(125) = (Core.getfield)((Core.getfield)(SSAValue(113), :I)::Tuple{Int64}, 1)::Int64 # line 73:
# meta: location broadcast.jl # line 151:
SSAValue(117) = (Base.select_value)((Base.getfield)(keep_1::Tuple{Bool,Bool}, 1)::Bool, SSAValue(124), (Base.getfield)(Idefault_1::Tuple{Int64,Int64}, 1)::Int64)::Int64
SSAValue(118) = (Base.select_value)((Core.getfield)(keep_1::Tuple{Bool,Bool}, 2)::Bool, SSAValue(125), (Core.getfield)(Idefault_1::Tuple{Int64,Int64}, 2)::Int64)::Int64 # line 153:
$(Expr(:inbounds, true))
val_1::Float64 = (Base.arrayref)(X::Array{Float64,2}, SSAValue(117), SSAValue(118))::Float64
$(Expr(:inbounds, :pop)) # line 155:
result::Float64 = (Base.mul_float)(val_1::Float64, val_1::Float64)::Float64 # line 156:
$(Expr(:inbounds, true))
# meta: location multidimensional.jl setindex! 300
(Base.arrayset)(C@_42::Array{Float64,2}, result::Float64, SSAValue(124), SSAValue(125))::Array{Float64,2}
# meta: pop location
$(Expr(:inbounds, :pop))
# meta: pop location # line 74:
i#724::Int64 = (Base.add_int)(i#724::Int64, 1)::Int64 # line 75:
$(Expr(:simdloop))
132:
goto 105
134: # line 79:
136:
goto 87
138:
# meta: pop location
# meta: pop location
# meta: pop location
# meta: pop location
goto 145 # line 321:
145:
# meta: pop location
# meta: pop location
$(Expr(:inbounds, :pop))
SSAValue(5) = $(Expr(:invoke, MethodInstance for _mapreduce(::Base.#identity, ::Base.#+, ::IndexLinear, ::Array{Float64,2}), :(Base._mapreduce), :(Base.identity), :(Base.+), :($(QuoteNode(IndexLinear()))), :(C@_42)))
SSAValue(7) = (Base.mul_float)(λ::Float64, SSAValue(5))::Float64
SSAValue(8) = (Base.add_float)(0.0, SSAValue(7))::Float64
(Core.setfield!)(C@_25::Core.Box, :contents, SSAValue(8))::Float64 # line 128:
∇C::Array{Float64,2} = $(Expr(:foreigncall, :(:jl_alloc_array_2d), Array{Float64,2}, svec(Any, Int64, Int64), Array{Float64,2}, 0, :(no_objects), 0, :(no_dims), 0)) # line 130:
sum_X::Array{Float64,1} = $(Expr(:invoke, MethodInstance for fill!(::Array{Float64,1}, ::Float64), :(Base.fill!), :($(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Float64,1}, svec(Any, Int64), Array{Float64,1}, 0, :(no_objects), 0))), :((Base.sitofp)(Float64, 0)::Float64))) # line 131:
SSAValue(177) = no_objects::Int64
SSAValue(178) = no_objects::Int64
$(Expr(:inbounds, false))
# meta: location array.jl zeros 265
# meta: location array.jl zeros 263
SSAValue(141) = SSAValue(177)
SSAValue(142) = SSAValue(178)
# meta: pop location
# meta: pop location
$(Expr(:inbounds, :pop))
K::Array{Float64,2} = $(Expr(:invoke, MethodInstance for fill!(::Array{Float64,2}, ::Float64), :(Base.fill!), :($(Expr(:foreigncall, :(:jl_alloc_array_2d), Array{Float64,2}, svec(Any, Int64, Int64), Array{Float64,2}, 0, SSAValue(141), 0, SSAValue(142), 0))), :((Base.sitofp)(Float64, 0)::Float64))) # line 132:
SSAValue(179) = no_objects::Int64
SSAValue(180) = no_objects::Int64
$(Expr(:inbounds, false))
# meta: location array.jl zeros 265
# meta: location array.jl zeros 263
SSAValue(147) = SSAValue(179)
SSAValue(148) = SSAValue(180)
# meta: pop location
# meta: pop location
$(Expr(:inbounds, :pop))
Q::Array{Float64,2} = $(Expr(:invoke, MethodInstance for fill!(::Array{Float64,2}, ::Float64), :(Base.fill!), :($(Expr(:foreigncall, :(:jl_alloc_array_2d), Array{Float64,2}, svec(Any, Int64, Int64), Array{Float64,2}, 0, SSAValue(147), 0, SSAValue(148), 0))), :((Base.sitofp)(Float64, 0)::Float64))) # line 134:
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl nthreads 19
SSAValue(149) = (Base.Threads.cglobal)(:jl_n_threads, Base.Threads.Cint)::Ptr{Int32}
SSAValue(150) = (Base.pointerref)(SSAValue(149), 1, 1)::Int32
# meta: pop location
$(Expr(:inbounds, :pop))
A_to_B::Array{Float64,1} = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Float64,1}, svec(Any, Int64), Array{Float64,1}, 0, :((Base.sext_int)(Int64, SSAValue(150))::Int64), 0)) # line 135:
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl nthreads 19
SSAValue(152) = (Base.Threads.cglobal)(:jl_n_threads, Base.Threads.Cint)::Ptr{Int32}
SSAValue(153) = (Base.pointerref)(SSAValue(152), 1, 1)::Int32
# meta: pop location
$(Expr(:inbounds, :pop))
A_to_C::Array{Float64,1} = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Float64,1}, svec(Any, Int64), Array{Float64,1}, 0, :((Base.sext_int)(Int64, SSAValue(153))::Int64), 0)) # line 136:
constant::Float64 = (Base.div_float)((Base.add_float)(α::Float64, (Base.sitofp)(Float64, 1)::Float64)::Float64, α::Float64)::Float64 # line 138:
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl nthreads 19
SSAValue(155) = (Base.Threads.cglobal)(:jl_n_threads, Base.Threads.Cint)::Ptr{Int32}
SSAValue(156) = (Base.pointerref)(SSAValue(155), 1, 1)::Int32
# meta: pop location
$(Expr(:inbounds, :pop))
triplets_A::Array{Int64,1} = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Int64,1}, svec(Any, Int64), Array{Int64,1}, 0, :((Base.sext_int)(Int64, SSAValue(156))::Int64), 0)) # line 139:
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl nthreads 19
SSAValue(158) = (Base.Threads.cglobal)(:jl_n_threads, Base.Threads.Cint)::Ptr{Int32}
SSAValue(159) = (Base.pointerref)(SSAValue(158), 1, 1)::Int32
# meta: pop location
$(Expr(:inbounds, :pop))
triplets_B::Array{Int64,1} = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Int64,1}, svec(Any, Int64), Array{Int64,1}, 0, :((Base.sext_int)(Int64, SSAValue(159))::Int64), 0)) # line 140:
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl nthreads 19
SSAValue(161) = (Base.Threads.cglobal)(:jl_n_threads, Base.Threads.Cint)::Ptr{Int32}
SSAValue(162) = (Base.pointerref)(SSAValue(161), 1, 1)::Int32
# meta: pop location
$(Expr(:inbounds, :pop))
triplets_C::Array{Int64,1} = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Int64,1}, svec(Any, Int64), Array{Int64,1}, 0, :((Base.sext_int)(Int64, SSAValue(162))::Int64), 0)) # line 144:
SSAValue(181) = (Base.select_value)((Base.sle_int)(1, no_dims::Int64)::Bool, no_dims::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_12::Int64 = 1
226:
unless (Base.not_int)((#temp#@_12::Int64 === (Base.add_int)(SSAValue(181), 1)::Int64)::Bool)::Bool goto 249
SSAValue(182) = #temp#@_12::Int64
SSAValue(183) = (Base.add_int)(#temp#@_12::Int64, 1)::Int64
k@_11::Int64 = SSAValue(182)
#temp#@_12::Int64 = SSAValue(183)
SSAValue(184) = (Base.select_value)((Base.sle_int)(1, no_objects::Int64)::Bool, no_objects::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_10::Int64 = 1
234:
unless (Base.not_int)((#temp#@_10::Int64 === (Base.add_int)(SSAValue(184), 1)::Int64)::Bool)::Bool goto 247
SSAValue(185) = #temp#@_10::Int64
SSAValue(186) = (Base.add_int)(#temp#@_10::Int64, 1)::Int64
i@_9::Int64 = SSAValue(185)
#temp#@_10::Int64 = SSAValue(186) # line 145:
$(Expr(:inbounds, true))
SSAValue(13) = (Base.add_float)((Base.arrayref)(sum_X::Array{Float64,1}, i@_9::Int64)::Float64, (Base.mul_float)((Base.arrayref)(X::Array{Float64,2}, i@_9::Int64, k@_11::Int64)::Float64, (Base.arrayref)(X::Array{Float64,2}, i@_9::Int64, k@_11::Int64)::Float64)::Float64)::Float64
(Base.arrayset)(sum_X::Array{Float64,1}, SSAValue(13), i@_9::Int64)::Array{Float64,1}
$(Expr(:inbounds, :pop))
245:
goto 234
247:
goto 226
249: # line 148:
SSAValue(187) = (Base.select_value)((Base.sle_int)(1, no_objects::Int64)::Bool, no_objects::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_18::Int64 = 1
253:
unless (Base.not_int)((#temp#@_18::Int64 === (Base.add_int)(SSAValue(187), 1)::Int64)::Bool)::Bool goto 342
SSAValue(188) = #temp#@_18::Int64
SSAValue(189) = (Base.add_int)(#temp#@_18::Int64, 1)::Int64
j::Int64 = SSAValue(188)
#temp#@_18::Int64 = SSAValue(189)
SSAValue(190) = (Base.select_value)((Base.sle_int)(1, no_objects::Int64)::Bool, no_objects::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_16::Int64 = 1
261:
unless (Base.not_int)((#temp#@_16::Int64 === (Base.add_int)(SSAValue(190), 1)::Int64)::Bool)::Bool goto 340
SSAValue(191) = #temp#@_16::Int64
SSAValue(192) = (Base.add_int)(#temp#@_16::Int64, 1)::Int64
i@_15::Int64 = SSAValue(191)
#temp#@_16::Int64 = SSAValue(192) # line 149:
$(Expr(:inbounds, true))
SSAValue(18) = (Base.add_float)((Base.arrayref)(sum_X::Array{Float64,1}, i@_15::Int64)::Float64, (Base.arrayref)(sum_X::Array{Float64,1}, j::Int64)::Float64)::Float64
(Base.arrayset)(K::Array{Float64,2}, SSAValue(18), i@_15::Int64, j::Int64)::Array{Float64,2}
$(Expr(:inbounds, :pop)) # line 150:
SSAValue(193) = (Base.select_value)((Base.sle_int)(1, no_dims::Int64)::Bool, no_dims::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_14::Int64 = 1
275:
unless (Base.not_int)((#temp#@_14::Int64 === (Base.add_int)(SSAValue(193), 1)::Int64)::Bool)::Bool goto 338
SSAValue(194) = #temp#@_14::Int64
SSAValue(195) = (Base.add_int)(#temp#@_14::Int64, 1)::Int64
k@_13::Int64 = SSAValue(194)
#temp#@_14::Int64 = SSAValue(195) # line 155:
$(Expr(:inbounds, true))
SSAValue(21) = (Base.add_float)((Base.arrayref)(K::Array{Float64,2}, i@_15::Int64, j::Int64)::Float64, (Base.mul_float)((Base.mul_float)((Base.sitofp)(Float64, -2)::Float64, (Base.arrayref)(X::Array{Float64,2}, i@_15::Int64, k@_13::Int64)::Float64)::Float64, (Base.arrayref)(X::Array{Float64,2}, j::Int64, k@_13::Int64)::Float64)::Float64)::Float64
(Base.arrayset)(K::Array{Float64,2}, SSAValue(21), i@_15::Int64, j::Int64)::Array{Float64,2}
$(Expr(:inbounds, :pop)) # line 156:
$(Expr(:inbounds, true))
SSAValue(164) = (Base.add_float)((Base.sitofp)(Float64, 1)::Float64, (Base.div_float)((Base.arrayref)(K::Array{Float64,2}, i@_15::Int64, j::Int64)::Float64, α::Float64)::Float64)::Float64
$(Expr(:inbounds, false))
# meta: location intfuncs.jl literal_pow 208
$(Expr(:inbounds, false))
# meta: location math.jl ^ 701
SSAValue(165) = (Base.sitofp)(Float64, -1)::Float64
# meta: location math.jl ^ 699
SSAValue(168) = $(Expr(:foreigncall, "llvm.pow.f64", Float64, svec(Float64, Float64), SSAValue(164), 0, SSAValue(165), 0, :($(Expr(:llvmcall)))))
SSAValue(169) = (Base.add_float)(SSAValue(164), SSAValue(165))::Float64
# meta: location math.jl nan_dom_err 300
unless (Base.and_int)((Base.ne_float)(SSAValue(168), SSAValue(168))::Bool, (Base.not_int)((Base.ne_float)(SSAValue(169), SSAValue(169))::Bool)::Bool)::Bool goto 301
#temp#@_78::Float64 = (Base.Math.throw)($(QuoteNode(DomainError())))::Union{}
goto 303
301:
#temp#@_78::Float64 = SSAValue(168)
303:
# meta: pop location
# meta: pop location
# meta: pop location
$(Expr(:inbounds, :pop))
# meta: pop location
$(Expr(:inbounds, :pop))
SSAValue(22) = #temp#@_78::Float64
(Base.arrayset)(Q::Array{Float64,2}, SSAValue(22), i@_15::Int64, j::Int64)::Array{Float64,2}
$(Expr(:inbounds, :pop)) # line 157:
$(Expr(:inbounds, true))
SSAValue(171) = (Base.add_float)((Base.sitofp)(Float64, 1)::Float64, (Base.div_float)((Base.arrayref)(K::Array{Float64,2}, i@_15::Int64, j::Int64)::Float64, α::Float64)::Float64)::Float64
SSAValue(170) = (Base.div_float)((Base.add_float)(α::Float64, (Base.sitofp)(Float64, 1)::Float64)::Float64, (Base.sitofp)(Float64, -2)::Float64)::Float64
$(Expr(:inbounds, false))
# meta: location math.jl ^ 699
SSAValue(174) = $(Expr(:foreigncall, "llvm.pow.f64", Float64, svec(Float64, Float64), SSAValue(171), 0, SSAValue(170), 0, :($(Expr(:llvmcall)))))
SSAValue(175) = (Base.add_float)(SSAValue(171), SSAValue(170))::Float64
$(Expr(:inbounds, false))
# meta: location math.jl nan_dom_err 300
unless (Base.and_int)((Base.ne_float)(SSAValue(174), SSAValue(174))::Bool, (Base.not_int)((Base.ne_float)(SSAValue(175), SSAValue(175))::Bool)::Bool)::Bool goto 326
#temp#@_79::Float64 = (Base.Math.throw)($(QuoteNode(DomainError())))::Union{}
goto 328
326:
#temp#@_79::Float64 = SSAValue(174)
328:
# meta: pop location
$(Expr(:inbounds, :pop))
# meta: pop location
$(Expr(:inbounds, :pop))
SSAValue(23) = #temp#@_79::Float64
(Base.arrayset)(K::Array{Float64,2}, SSAValue(23), i@_15::Int64, j::Int64)::Array{Float64,2}
$(Expr(:inbounds, :pop))
336:
goto 275
338:
goto 261
340:
goto 253
342: # line 162:
# meta: location threadingconstructs.jl # line 28:
SSAValue(24) = $(Expr(:new, UnitRange{Int64}, 1, :((Base.select_value)((Base.sle_int)(1, no_triplets)::Bool, no_triplets, (Base.sub_int)(1, 1)::Int64)::Int64)))
(Core.setfield!)(range::Core.Box, :contents, SSAValue(24))::UnitRange{Int64} # line 29:
threadsfor_fun::Embeddings.##122#threadsfor_fun#7{Array{Float64,2},Int64,Array{Int64,2},Array{Float64,1},Array{Float64,2},Array{Float64,2},Array{Float64,2},Array{Float64,1},Array{Float64,1},Float64,Array{Int64,1},Array{Int64,1},Array{Int64,1}} = $(Expr(:new, Embeddings.##122#threadsfor_fun#7{Array{Float64,2},Int64,Array{Int64,2},Array{Float64,1},Array{Float64,2},Array{Float64,2},Array{Float64,2},Array{Float64,1},Array{Float64,1},Float64,Array{Int64,1},Array{Int64,1},Array{Int64,1}}, :(X), :(no_dims), :(triplets), :(P), :(C@_25), :(∇C), :(K), :(Q), :(A_to_B), :(A_to_C), :(constant), :(triplets_A), :(triplets_B), :(triplets_C), :(range))) # line 67:
$(Expr(:inbounds, false))
# meta: location threadingconstructs.jl threadid 10
SSAValue(176) = $(Expr(:foreigncall, :(:jl_threadid), Int16, svec()))
# meta: pop location
$(Expr(:inbounds, :pop))
SSAValue(25) = (Base.not_int)(((Base.add_int)((Base.sext_int)(Int64, SSAValue(176))::Int64, 1)::Int64 === 1)::Bool)::Bool
unless SSAValue(25) goto 360
#temp#@_38::Bool = SSAValue(25)
goto 362
360:
#temp#@_38::Bool = (Core.getfield)(Base.Threads.in_threaded_loop, :x)::Bool
362:
unless #temp#@_38::Bool goto 367 # line 69:
$(Expr(:invoke, MethodInstance for (::Embeddings.##122#threadsfor_fun#7{Array{Float64,2},Int64,Array{Int64,2},Array{Float64,1},Array{Float64,2},Array{Float64,2},Array{Float64,2},Array{Float64,1},Array{Float64,1},Float64,Array{Int64,1},Array{Int64,1},Array{Int64,1}})(::Bool), :(threadsfor_fun), true))
goto 382
367: # line 71:
$(Expr(:inbounds, false))
# meta: location refpointer.jl setindex! 121
(Core.setfield!)(Base.Threads.in_threaded_loop, :x, true)::Bool
# meta: pop location
$(Expr(:inbounds, :pop)) # line 73:
$(Expr(:foreigncall, :(:jl_threading_run), Ref{Void}, svec(Any), :(threadsfor_fun), 0)) # line 74:
$(Expr(:inbounds, false))
# meta: location refpointer.jl setindex! 121
(Core.setfield!)(Base.Threads.in_threaded_loop, :x, false)::Bool
# meta: pop location
$(Expr(:inbounds, :pop))
382:
# meta: pop location # line 188:
SSAValue(196) = (Base.select_value)((Base.sle_int)(1, no_dims::Int64)::Bool, no_dims::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_22::Int64 = 1
387:
unless (Base.not_int)((#temp#@_22::Int64 === (Base.add_int)(SSAValue(196), 1)::Int64)::Bool)::Bool goto 410
SSAValue(197) = #temp#@_22::Int64
SSAValue(198) = (Base.add_int)(#temp#@_22::Int64, 1)::Int64
i@_21::Int64 = SSAValue(197)
#temp#@_22::Int64 = SSAValue(198)
SSAValue(199) = (Base.select_value)((Base.sle_int)(1, no_objects::Int64)::Bool, no_objects::Int64, (Base.sub_int)(1, 1)::Int64)::Int64
#temp#@_20::Int64 = 1
395:
unless (Base.not_int)((#temp#@_20::Int64 === (Base.add_int)(SSAValue(199), 1)::Int64)::Bool)::Bool goto 408
SSAValue(200) = #temp#@_20::Int64
SSAValue(201) = (Base.add_int)(#temp#@_20::Int64, 1)::Int64
n::Int64 = SSAValue(200)
#temp#@_20::Int64 = SSAValue(201) # line 190:
$(Expr(:inbounds, true))
SSAValue(31) = (Base.add_float)((Base.neg_float)((Base.arrayref)(∇C::Array{Float64,2}, n::Int64, i@_21::Int64)::Float64)::Float64, (Base.mul_float)((Base.mul_float)((Base.sitofp)(Float64, 2)::Float64, λ::Float64)::Float64, (Base.arrayref)(X::Array{Float64,2}, n::Int64, i@_21::Int64)::Float64)::Float64)::Float64
(Base.arrayset)(∇C::Array{Float64,2}, SSAValue(31), n::Int64, i@_21::Int64)::Array{Float64,2}
$(Expr(:inbounds, :pop))
406:
goto 395
408:
goto 387
410: # line 193:
return (Core.typeassert)((Base.convert)(SSAValue(0), (Core.tuple)((Core.getfield)(C@_25::Core.Box, :contents)::Any, ∇C::Array{Float64,2})::Tuple{Any,Array{Float64,2}})::Tuple{Any,Array{Float64,2}}, SSAValue(0))::Tuple{Float64,Array{Float64,2}}
end::Tuple{Float64,Array{Float64,2}}