julia
julia copied to clipboard
Optimize jl_tls_world_age ccall
This makes it so we avoid a ccall boundary and potentially optimize away repeated world age checks
With the latest change we avoid any of the wird invariant.load stuff but it still lifts the check to a preheader in a function like
function foo(oc, arr)
sum = 0.0
for i in eachindex(arr)
if (oc.world) == Base.tls_world_age()
sum += oc(arr[i])
else
sum += arr[i]
end
end
sum
end