-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ForwardDiff Decapode Gradient Fail Example #182
Comments
So Decapodes has two different code generation options, one that uses PreallocationTools and the DiffCaches, and one that doesn't. This is an example of code that does use PreallocationTools, and ForwardDiff doesn't work. |
@ChrisRackauckas I think the next steps for Decapode calibration stuff is to make sure that ForwardDiff works in situations like this, and then making sure that For context, I have a heat equation decapode example that uses PreallocationTools, ForwardDiff works, and |
@ChrisRackauckas I think this is the most pared down I can get it while still getting the error. using Catlab
using Catlab.Graphics
using CombinatorialSpaces
using Decapodes
using ComponentArrays
using ForwardDiff
using Zygote
using SciMLSensitivity
# External Dependencies
using MLStyle
using MultiScaleArrays
using LinearAlgebra
using OrdinaryDiffEq
using JLD2
using SparseArrays
using Statistics
using GeometryBasics: Point2, Point3
Point2D = Point2{Float64};
Point3D = Point3{Float64};
using DiagrammaticEquations
using DiagrammaticEquations.Deca
halfar_eq2 = @decapode begin
h::Form0
Γ::Form1
n::Constant
ḣ == ∂ₜ(h)
ḣ == ∘(⋆, d, ⋆)(Γ * d(h) * avg₀₁(mag(♯(d(h)))^(n - 1)) * avg₀₁(h^(n + 2)))
end
glens_law = @decapode begin
Γ::Form1
(A, ρ, g, n)::Constant
Γ == (2.0 / (n + 2.0)) * A * (ρ * g)^n
end
@info("Decapodes Defined")
ice_dynamics_composition_diagram = @relation () begin
dynamics(Γ, n)
stress(Γ, n)
end
ice_dynamics_cospan = oapply(ice_dynamics_composition_diagram,
[Open(halfar_eq2, [:Γ, :n]),
Open(glens_law, [:Γ, :n])])
ice_dynamics = apex(ice_dynamics_cospan)
ice_dynamics1D = expand_operators(ice_dynamics)
infer_types!(ice_dynamics1D, op1_inf_rules_1D, op2_inf_rules_1D)
resolve_overloads!(ice_dynamics1D, op1_res_rules_1D, op2_res_rules_1D)
s_prime = EmbeddedDeltaSet1D{Bool,Point2D}()
add_vertices!(s_prime, 10, point=Point2D.(range(-2.0, 2.0, length= 10), 0.0))
add_edges!(s_prime, 1:nv(s_prime)-1, 2:nv(s_prime))
orient!(s_prime)
s = EmbeddedDeltaDualComplex1D{Bool,Float64,Point2D}(s_prime)
subdivide_duals!(s, Circumcenter())
function generate(sd, my_symbol; hodge=GeometricHodge())
op = @match my_symbol begin
:♯ => x -> begin
# This is an implementation of the "sharp" operator from the exterior
# calculus, which takes co-vector fields to vector fields.
# This could be up-streamed to the CombinatorialSpaces.jl library. (i.e.
# this operation is not bespoke to this simulation.)
e_vecs = map(edges(sd)) do e
point(sd, sd[e, :∂v0]) - point(sd, sd[e, :∂v1])
end
neighbors = map(vertices(sd)) do v
union(incident(sd, v, :∂v0), incident(sd, v, :∂v1))
end
n_vecs = map(neighbors) do es
[e_vecs[e] for e in es]
end
map(neighbors, n_vecs) do es, nvs
sum([nv * norm(nv) * x[e] for (e, nv) in zip(es, nvs)]) / sum(norm.(nvs))
end
end
:mag => x -> norm.(x)
x => error("Unmatched operator $my_symbol")
end
return (args...) -> op(args...)
end
decapode_code = gensim(ice_dynamics1D, dimension=1, preallocate=true)
file = open("ice_sheet1D_alloc.jl", "w")
write(file, string("decapode_f = ", decapode_code))
close(file)
include("ice_sheet1D_alloc.jl")
fₘ = decapode_f(s, generate)
h₀ = map(x -> exp(-2 * x[1]^2), point(s_prime))
flow_rate, ice_density, u_init_arr = 1e-3, 910.0, h₀
n = 3.0
ρ = ice_density
g = 9.8101
A = fill(flow_rate, ne(s))
tₑ = 10.0
u₀ = ComponentArray(dynamics_h=u_init_arr)
constants_and_parameters = ComponentArray(
n=n,
stress_ρ=ρ,
stress_g=g,
stress_A=A)
data_prob = ODEProblem{true,SciMLBase.FullSpecialize}(fₘ, u₀, (0, tₑ), constants_and_parameters)
decapode_sol = solve(data_prob, Tsit5())
reference_dat = last(decapode_sol).dynamics_h
function loss(u) #only compares last time step
newp = ComponentArray(n=n, stress_ρ=u[1], stress_g=g, stress_A=A)
prob = remake(data_prob, p=newp)
sol = solve(prob, Rodas4(autodiff=false), sensealg=GaussAdjoint())
current_dat = last(sol).dynamics_h
sum(abs2, reference_dat .- current_dat)
end
#loss([800.0])
Zygote.gradient(loss, [800.0]) |
The code generation gives something like this decapode_f = begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:758 =#
(mesh, operators, hodge = GeometricHodge())->begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:758 =#
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:759 =#
begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:235 =#
(var"GenSim-M_d₀", d₀) = default_dec_matrix_generate(mesh, :d₀, hodge)
(var"GenSim-M_avg₀₁", avg₀₁) = default_dec_matrix_generate(mesh, :avg₀₁, hodge)
(var"GenSim-M_⋆₁", ⋆₁) = default_dec_matrix_generate(mesh, :⋆₁, hodge)
(var"GenSim-M_dual_d₀", dual_d₀) = default_dec_matrix_generate(mesh, :dual_d₀, hodge)
(var"GenSim-M_⋆₀⁻¹", ⋆₀⁻¹) = default_dec_matrix_generate(mesh, :⋆₀⁻¹, hodge)
♯ = operators(mesh, :♯)
mag = operators(mesh, :mag)
end
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:760 =#
begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:619 =#
var"GenSim-M_GenSim-ConMat_1" = var"GenSim-M_⋆₀⁻¹" * var"GenSim-M_dual_d₀" * var"GenSim-M_⋆₁"
var"GenSim-ConMat_1" = (x->var"GenSim-M_GenSim-ConMat_1" * x)
end
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:761 =#
begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:140 =#
var"__dynamics_•1" = Decapodes.FixedSizeDiffCache(Vector{Float64}(undef, nparts(mesh, :E)))
var"__dynamics_•6" = Decapodes.FixedSizeDiffCache(Vector{Float64}(undef, nparts(mesh, :E)))
__dynamics_mult_3 = Decapodes.FixedSizeDiffCache(Vector{Float64}(undef, nparts(mesh, :E)))
__dynamics_ḣ = Decapodes.FixedSizeDiffCache(Vector{Float64}(undef, nparts(mesh, :V)))
end
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:762 =#
f(du, u, p, t) = begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:762 =#
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:763 =#
begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:297 =#
dynamics_h = u.dynamics_h
n = p.n
stress_A = p.stress_A
stress_ρ = p.stress_ρ
stress_g = p.stress_g
var"1" = 1.0
var"2" = 2.0
var"2.0" = 2.0
end
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:764 =#
begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:534 =#
var"dynamics_•1" = Decapodes.get_tmp(var"__dynamics_•1", u)
var"dynamics_•6" = Decapodes.get_tmp(var"__dynamics_•6", u)
dynamics_mult_3 = Decapodes.get_tmp(__dynamics_mult_3, u)
dynamics_ḣ = Decapodes.get_tmp(__dynamics_ḣ, u)
end
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:765 =#
mul!(var"dynamics_•1", var"GenSim-M_d₀", dynamics_h)
mul!(var"dynamics_•6", var"GenSim-M_d₀", dynamics_h)
var"dynamics_•5" = ♯(var"dynamics_•6")
var"dynamics_•4" = mag(var"dynamics_•5")
var"dynamics_•7" = n .- var"1"
var"dynamics_•3" = var"dynamics_•4" .^ var"dynamics_•7"
var"stress_•3" = stress_ρ .* stress_g
var"stress_•2" = var"stress_•3" .^ n
dynamics_sum_1 = (.+)(n, var"2")
stress_sum_1 = (.+)(n, var"2.0")
var"dynamics_•2" = avg₀₁(var"dynamics_•3")
var"dynamics_•9" = dynamics_h .^ dynamics_sum_1
var"stress_•1" = var"2.0" ./ stress_sum_1
stress_mult_1 = var"stress_•1" .* stress_A
Γ = stress_mult_1 .* var"stress_•2"
var"dynamics_•8" = avg₀₁(var"dynamics_•9")
dynamics_mult_3 .= Γ .* var"dynamics_•1"
dynamics_mult_1 = dynamics_mult_3 .* var"dynamics_•2"
dynamics_mult_2 = dynamics_mult_1 .* var"dynamics_•8"
mul!(dynamics_ḣ, var"GenSim-M_GenSim-ConMat_1", dynamics_mult_2)
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:766 =#
begin
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:338 =#
setproperty!(du, :dynamics_h, dynamics_ḣ)
end
#= /home/jadonclugston/.julia/packages/Decapodes/MGJA6/src/simulation.jl:767 =#
return nothing
end
end
end where |
The issue comes from function reinterpret(::Type{T}, a::A) where {T,N,S,A<:AbstractArray{S, N}}
function thrownonint(S::Type, T::Type, dim)
@noinline
throw(ArgumentError("""
cannot reinterpret an `$(S)` array to `$(T)` whose first dimension has size `$(dim)`.
The resulting array would have non-integral first dimension.
"""))
end
function throwaxes1(S::Type, T::Type, ax1)
@noinline
throw(ArgumentError("cannot reinterpret a `$(S)` array to `$(T)` when the first axis is $ax1. Try reshaping first."))
end
isbitstype(T) || throwbits(S, T, T)
isbitstype(S) || throwbits(S, T, S)
(N != 0 || sizeof(T) == sizeof(S)) || throwsize0(S, T, "different")
if N != 0 && sizeof(S) != sizeof(T)
ax1 = axes(a)[1]
dim = length(ax1)
if issingletontype(T)
issingletontype(S) || throwsingleton(S, T)
else
rem(dim*sizeof(S),sizeof(T)) == 0 || thrownonint(S, T, dim)
end
first(ax1) == 1 || throwaxes1(S, T, ax1)
end
readable = array_subpadding(T, S)
writable = array_subpadding(S, T)
new{T, N, S, A, false}(a, readable, writable)
end
this line is being triggered: ~~but as far as I can tell from debugging, so I'm not sure why the error should be triggering~~ actually I was doing something wrong, I think so
|
|
More direct: using Catlab
using Catlab.Graphics
using CombinatorialSpaces
using Decapodes
using ComponentArrays
using ForwardDiff
using Zygote
using SciMLSensitivity
# External Dependencies
using MLStyle
using MultiScaleArrays
using LinearAlgebra
using OrdinaryDiffEq
using JLD2
using SparseArrays
using Statistics
using GeometryBasics: Point2, Point3
Point2D = Point2{Float64};
Point3D = Point3{Float64};
using DiagrammaticEquations
using DiagrammaticEquations.Deca
halfar_eq2 = @decapode begin
h::Form0
Γ::Form1
n::Constant
ḣ == ∂ₜ(h)
ḣ == ∘(⋆, d, ⋆)(Γ * d(h) * avg₀₁(mag(♯(d(h)))^(n - 1)) * avg₀₁(h^(n + 2)))
end
glens_law = @decapode begin
Γ::Form1
(A, ρ, g, n)::Constant
Γ == (2.0 / (n + 2.0)) * A * (ρ * g)^n
end
@info("Decapodes Defined")
ice_dynamics_composition_diagram = @relation () begin
dynamics(Γ, n)
stress(Γ, n)
end
ice_dynamics_cospan = oapply(ice_dynamics_composition_diagram,
[Open(halfar_eq2, [:Γ, :n]),
Open(glens_law, [:Γ, :n])])
ice_dynamics = apex(ice_dynamics_cospan)
ice_dynamics1D = expand_operators(ice_dynamics)
infer_types!(ice_dynamics1D, op1_inf_rules_1D, op2_inf_rules_1D)
resolve_overloads!(ice_dynamics1D, op1_res_rules_1D, op2_res_rules_1D)
s_prime = EmbeddedDeltaSet1D{Bool,Point2D}()
add_vertices!(s_prime, 10, point=Point2D.(range(-2.0, 2.0, length= 10), 0.0))
add_edges!(s_prime, 1:nv(s_prime)-1, 2:nv(s_prime))
orient!(s_prime)
s = EmbeddedDeltaDualComplex1D{Bool,Float64,Point2D}(s_prime)
subdivide_duals!(s, Circumcenter())
function generate(sd, my_symbol; hodge=GeometricHodge())
op = @match my_symbol begin
:♯ => x -> begin
# This is an implementation of the "sharp" operator from the exterior
# calculus, which takes co-vector fields to vector fields.
# This could be up-streamed to the CombinatorialSpaces.jl library. (i.e.
# this operation is not bespoke to this simulation.)
e_vecs = map(edges(sd)) do e
point(sd, sd[e, :∂v0]) - point(sd, sd[e, :∂v1])
end
neighbors = map(vertices(sd)) do v
union(incident(sd, v, :∂v0), incident(sd, v, :∂v1))
end
n_vecs = map(neighbors) do es
[e_vecs[e] for e in es]
end
map(neighbors, n_vecs) do es, nvs
sum([nv * norm(nv) * x[e] for (e, nv) in zip(es, nvs)]) / sum(norm.(nvs))
end
end
:mag => x -> norm.(x)
x => error("Unmatched operator $my_symbol")
end
return (args...) -> op(args...)
end
decapode_code = gensim(ice_dynamics1D, dimension=1, preallocate=false)
#file = open("ice_sheet1D_alloc.jl", "w")
#write(file, string("decapode_f = ", decapode_code))
#close(file)
include("ice_sheet1D_alloc.jl")
fₘ = decapode_f(s, generate)
h₀ = map(x -> exp(-2 * x[1]^2), point(s_prime))
flow_rate, ice_density, u_init_arr = 1e-3, 910.0, h₀
n = 3.0
ρ = ice_density
g = 9.8101
A = fill(flow_rate, ne(s))
tₑ = 10.0
u₀ = ComponentArray(dynamics_h=u_init_arr)
constants_and_parameters = ComponentArray(
n=n,
stress_ρ=ρ,
stress_g=g,
stress_A=A)
data_prob = ODEProblem{true,SciMLBase.FullSpecialize}(fₘ, u₀, (0, tₑ), constants_and_parameters)
function steploss(du,u) #only compares last time step
data_prob.f(du,u,data_prob.p,data_prob.tspan[1])
nothing
end
u = copy(data_prob.u0)
du = zero(u)
d_u = zero(u)
d_du = zero(u)
using Enzyme
Enzyme.autodiff(Reverse, steploss, Duplicated(du, d_du), Duplicated(u,d_u))
using Cthulhu
@descend data_prob.f(du,u,data_prob.p,data_prob.tspan[1]) |
@wsmoses it seems the sharp function here gives Enzyme some issues. :♯ => x -> begin
# This is an implementation of the "sharp" operator from the exterior
# calculus, which takes co-vector fields to vector fields.
# This could be up-streamed to the CombinatorialSpaces.jl library. (i.e.
# this operation is not bespoke to this simulation.)
e_vecs = map(edges(sd)) do e
point(sd, sd[e, :∂v0]) - point(sd, sd[e, :∂v1])
end
neighbors = map(vertices(sd)) do v
union(incident(sd, v, :∂v0), incident(sd, v, :∂v1))
end
n_vecs = map(neighbors) do es
[e_vecs[e] for e in es]
end
map(neighbors, n_vecs) do es, nvs
sum([nv * norm(nv) * x[e] for (e, nv) in zip(es, nvs)]) / sum(norm.(nvs))
end
end @jpfairbanks if I understand correctly, |
For debugging I started manually modifying the generated function: decapode_f = begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:758 =#
(mesh, operators, hodge = GeometricHodge())->begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:758 =#
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:759 =#
begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:235 =#
(var"GenSim-M_d₀", d₀) = default_dec_matrix_generate(mesh, :d₀, hodge)
(var"GenSim-M_avg₀₁", avg₀₁) = default_dec_matrix_generate(mesh, :avg₀₁, hodge)
(var"GenSim-M_⋆₁", ⋆₁) = default_dec_matrix_generate(mesh, :⋆₁, hodge)
(var"GenSim-M_dual_d₀", dual_d₀) = default_dec_matrix_generate(mesh, :dual_d₀, hodge)
(var"GenSim-M_⋆₀⁻¹", ⋆₀⁻¹) = default_dec_matrix_generate(mesh, :⋆₀⁻¹, hodge)
♯ = x -> begin
# This is an implementation of the "sharp" operator from the exterior
# calculus, which takes co-vector fields to vector fields.
# This could be up-streamed to the CombinatorialSpaces.jl library. (i.e.
# this operation is not bespoke to this simulation.)
e_vecs = map(edges(mesh)) do e
point(mesh, mesh[e, :∂v0]) - point(mesh, mesh[e, :∂v1])
end
neighbors = map(vertices(mesh)) do v
union(incident(mesh, v, :∂v0), incident(mesh, v, :∂v1))
end
n_vecs = map(neighbors) do es
[e_vecs[e] for e in es]
end
res = zeros(Point2D, length(n_vecs))
map!(res, neighbors, n_vecs) do es, nvs
sum([nv * norm(nv) * x[e] for (e, nv) in zip(es, nvs)]) / sum(norm.(nvs))
end
res
end
mag = x -> norm.(x)
end
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:760 =#
begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:619 =#
var"GenSim-M_GenSim-ConMat_1" = var"GenSim-M_⋆₀⁻¹" * var"GenSim-M_dual_d₀" * var"GenSim-M_⋆₁"
var"GenSim-ConMat_1" = (x->var"GenSim-M_GenSim-ConMat_1" * x)
end
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:761 =#
begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:140 =#
end
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:762 =#
let ♯=♯, mag=mag
f(du, u, p, t) = begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:762 =#
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:763 =#
begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:297 =#
dynamics_h = u.dynamics_h
n = p.n
stress_A = p.stress_A
stress_ρ = p.stress_ρ
stress_g = p.stress_g
var"1" = 1.0
var"2" = 2.0
var"2.0" = 2.0
end
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:764 =#
begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:534 =#
end
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:765 =#
var"dynamics_•1" = d₀(dynamics_h)
var"dynamics_•6" = d₀(dynamics_h)
var"dynamics_•5" = ♯(var"dynamics_•6")
var"dynamics_•4" = mag(var"dynamics_•5")
var"dynamics_•7" = n .- var"1"
var"dynamics_•3" = var"dynamics_•4" .^ var"dynamics_•7"
var"stress_•3" = stress_ρ .* stress_g
var"stress_•2" = var"stress_•3" .^ n
dynamics_sum_1 = (.+)(n, var"2")
stress_sum_1 = (.+)(n, var"2.0")
var"dynamics_•2" = avg₀₁(var"dynamics_•3")
var"dynamics_•9" = dynamics_h .^ dynamics_sum_1
var"stress_•1" = var"2.0" ./ stress_sum_1
stress_mult_1 = var"stress_•1" .* stress_A
Γ = stress_mult_1 .* var"stress_•2"
var"dynamics_•8" = avg₀₁(var"dynamics_•9")
dynamics_mult_3 = Γ .* var"dynamics_•1"
dynamics_mult_1 = dynamics_mult_3 .* var"dynamics_•2"
dynamics_mult_2 = dynamics_mult_1 .* var"dynamics_•8"
dynamics_ḣ = var"GenSim-ConMat_1"(dynamics_mult_2)
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:766 =#
begin
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:338 =#
setproperty!(du, :dynamics_h, dynamics_ḣ)
end
#= /Users/chrisrackauckas/.julia/packages/Decapodes/MGJA6/src/simulation.jl:767 =#
return nothing
end
end
end
end This is what is being differentiated and giving Enzyme the type analysis error. res = zeros(Point2D, length(n_vecs))
map!(res, neighbors, n_vecs) do es, nvs
sum([nv * norm(nv) * x[e] for (e, nv) in zip(es, nvs)]) / sum(norm.(nvs))
end
res
In-place map forces the return value, but that still errors the same. This means it's pretty isolated down to the constructs sd[e, :∂v0] and incident(sd, v, :∂v0) being the weird ones, so I'm pretty sure however they are working is something Enzyme disagrees with. |
@wsmoses I think it's a missing BLAS rule? ERROR: MethodError: no method matching augmented_primal(::EnzymeCore.EnzymeRules.RevConfigWidth{…}, ::Const{…}, ::Type{…}, ::Duplicated{…}, ::Duplicated{…}, ::Duplicated{…}, ::Const{…}, ::Const{…})
Closest candidates are:
augmented_primal(::EnzymeCore.EnzymeRules.RevConfig, ::Const{typeof(mul!)}, ::Type{RT}, ::Annotation{<:StridedVecOrMat}, ::Const{<:Union{SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, SubArray{Tv, 2, <:SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, Tuple{Base.Slice{Base.OneTo{Int64}}, I}} where I<:AbstractUnitRange} where {Tv, Ti}}, ::Annotation{<:StridedVecOrMat}, ::Annotation{<:Number}, ::Annotation{<:Number}) where RT
@ Enzyme ~/.julia/packages/Enzyme/azJki/src/internal_rules.jl:732
augmented_primal(::EnzymeCore.EnzymeRules.RevConfig, ::Const{Type{BigFloat}}, ::Type{<:Union{BatchDuplicated, BatchDuplicatedNoNeed, Duplicated, DuplicatedNoNeed}}, ::Any...)
@ Enzyme ~/.julia/packages/Enzyme/azJki/src/internal_rules.jl:1404
augmented_primal(::Any, ::Const{typeof(QuadGK.quadgk)}, ::Type{RT}, ::Any, ::Annotation{T}...; kws...) where {RT, T}
@ QuadGKEnzymeExt ~/.julia/packages/QuadGK/BjmU0/ext/QuadGKEnzymeExt.jl:6
...
Stacktrace:
[1] custom_rule_method_error
@ ~/.julia/packages/Enzyme/azJki/src/rules/customrules.jl:452 [inlined]
[2] mul!
@ ~/.julia/juliaup/julia-1.10.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:237 [inlined]
[3] *
@ ~/.julia/juliaup/julia-1.10.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:57 [inlined]
[4] #15
@ ~/.julia/packages/Decapodes/MGJA6/src/operators.jl:99 [inlined]
[5] f
@ ~/Desktop/askem/ice_sheet1D_alloc.jl:72
[6] ODEFunction
@ ~/.julia/packages/SciMLBase/BWkqx/src/scimlfunctions.jl:2362 [inlined]
[7] ODEFunction
@ ~/.julia/packages/SciMLBase/BWkqx/src/scimlfunctions.jl:0 [inlined]
[8] augmented_julia_ODEFunction_16361_inner_1wrap
@ ~/.julia/packages/SciMLBase/BWkqx/src/scimlfunctions.jl:0
[9] macro expansion
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:8369 [inlined]
[10] enzyme_call
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7932 [inlined]
[11] AugmentedForwardThunk
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7769 [inlined]
[12] runtime_generic_augfwd(activity::Type{…}, runtimeActivity::Val{…}, width::Val{…}, ModifiedBetween::Val{…}, RT::Val{…}, f::ODEFunction{…}, df::ODEFunction{…}, primal_1::ComponentVector{…}, shadow_1_1::ComponentVector{…}, primal_2::ComponentVector{…}, shadow_2_1::ComponentVector{…}, primal_3::ComponentVector{…}, shadow_3_1::ComponentVector{…}, primal_4::Float64, shadow_4_1::Base.RefValue{…})
@ Enzyme.Compiler ~/.julia/packages/Enzyme/azJki/src/rules/jitrules.jl:483
[13] steploss
@ ~/Desktop/askem/mwe.jl:126 [inlined]
[14] steploss
@ ~/Desktop/askem/mwe.jl:0 [inlined]
[15] diffejulia_steploss_11669_inner_1wrap
@ ~/Desktop/askem/mwe.jl:0
[16] macro expansion
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:8369 [inlined]
[17] enzyme_call
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7932 [inlined]
[18] CombinedAdjointThunk
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7705 [inlined]
[19] autodiff
@ ~/.julia/packages/Enzyme/azJki/src/Enzyme.jl:491 [inlined]
[20] autodiff
@ ~/.julia/packages/Enzyme/azJki/src/Enzyme.jl:537 [inlined]
[21] autodiff(::ReverseMode{…}, ::typeof(steploss), ::Duplicated{…}, ::Duplicated{…})
@ Enzyme ~/.julia/packages/Enzyme/azJki/src/Enzyme.jl:504
[22] top-level scope
@ ~/Desktop/askem/mwe.jl:138
Some type information was truncated. Use `show(err)` to see complete types. Got this by adding: using Enzyme
Enzyme.API.strictAliasing!(false)
Enzyme.autodiff(Reverse, steploss, Duplicated(du, d_du), Duplicated(u,d_u)) https://github.com/JuliaLang/julia/blob/v1.10.6/stdlib/LinearAlgebra/src/matmul.jl#L237 |
Can you show the full types of the MethodError? |
julia> show(err)
1-element ExceptionStack:
LoadError: MethodError: no method matching augmented_primal(::EnzymeCore.EnzymeRules.RevConfigWidth{1, true, true, (false, true, true, false, false, false), false}, ::Const{typeof(mul!)}, ::Type{Duplicated{Vector{Float64}}}, ::Duplicated{Vector{Float64}}, ::Duplicated{SparseMatrixCSC{Int8, Int32}}, ::Duplicated{SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}}, ::Const{Bool}, ::Const{Bool})
Closest candidates are:
augmented_primal(::EnzymeCore.EnzymeRules.RevConfig, ::Const{typeof(mul!)}, ::Type{RT}, ::Annotation{<:StridedVecOrMat}, ::Const{<:Union{SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, SubArray{Tv, 2, <:SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, Tuple{Base.Slice{Base.OneTo{Int64}}, I}} where I<:AbstractUnitRange} where {Tv, Ti}}, ::Annotation{<:StridedVecOrMat}, ::Annotation{<:Number}, ::Annotation{<:Number}) where RT
@ Enzyme ~/.julia/packages/Enzyme/azJki/src/internal_rules.jl:732
augmented_primal(::EnzymeCore.EnzymeRules.RevConfig, ::Const{Type{BigFloat}}, ::Type{<:Union{BatchDuplicated, BatchDuplicatedNoNeed, Duplicated, DuplicatedNoNeed}}, ::Any...)
@ Enzyme ~/.julia/packages/Enzyme/azJki/src/internal_rules.jl:1404
augmented_primal(::Any, ::Const{typeof(QuadGK.quadgk)}, ::Type{RT}, ::Any, ::Annotation{T}...; kws...) where {RT, T}
@ QuadGKEnzymeExt ~/.julia/packages/QuadGK/BjmU0/ext/QuadGKEnzymeExt.jl:6
...
Stacktrace:
[1] custom_rule_method_error
@ ~/.julia/packages/Enzyme/azJki/src/rules/customrules.jl:452 [inlined]
[2] mul!
@ ~/.julia/juliaup/julia-1.10.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:237 [inlined]
[3] *
@ ~/.julia/juliaup/julia-1.10.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:57 [inlined]
[4] #15
@ ~/.julia/packages/Decapodes/MGJA6/src/operators.jl:99 [inlined]
[5] f
@ ~/Desktop/askem/ice_sheet1D_alloc.jl:72
[6] ODEFunction
@ ~/.julia/packages/SciMLBase/BWkqx/src/scimlfunctions.jl:2362 [inlined]
[7] ODEFunction
@ ~/.julia/packages/SciMLBase/BWkqx/src/scimlfunctions.jl:0 [inlined]
[8] augmented_julia_ODEFunction_17737_inner_1wrap
@ ~/.julia/packages/SciMLBase/BWkqx/src/scimlfunctions.jl:0
[9] macro expansion
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:8369 [inlined]
[10] enzyme_call
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7932 [inlined]
[11] AugmentedForwardThunk
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7769 [inlined]
[12] runtime_generic_augfwd(activity::Type{Val{(true, true, true, true, true)}}, runtimeActivity::Val{false}, width::Val{1}, ModifiedBetween::Val{(true, true, true, true, true)}, RT::Val{@NamedTuple{1, 2, 3}}, f::ODEFunction{true, SciMLBase.FullSpecialize, var"#f#53"{var"#42#52"{SparseMatrixCSC{Float64, Int64}}, Decapodes.var"#37#38"{SparseMatrixCSC{Float64, Int32}}, Decapodes.var"#15#16"{SparseMatrixCSC{Int8, Int32}}, var"#34#44"{EmbeddedDeltaDualComplex1D{Bool, Float64, GeometryBasics.Point{2, Float64}}}, var"#41#51"}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing, Nothing, Nothing}, df::ODEFunction{true, SciMLBase.FullSpecialize, var"#f#53"{var"#42#52"{SparseMatrixCSC{Float64, Int64}}, Decapodes.var"#37#38"{SparseMatrixCSC{Float64, Int32}}, Decapodes.var"#15#16"{SparseMatrixCSC{Int8, Int32}}, var"#34#44"{EmbeddedDeltaDualComplex1D{Bool, Float64, GeometryBasics.Point{2, Float64}}}, var"#41#51"}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing, Nothing, Nothing}, primal_1::ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(dynamics_h = 1:10,)}}}, shadow_1_1::ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(dynamics_h = 1:10,)}}}, primal_2::ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(dynamics_h = 1:10,)}}}, shadow_2_1::ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(dynamics_h = 1:10,)}}}, primal_3::ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(n = 1, stress_ρ = 2, stress_g = 3, stress_A = 4:12)}}}, shadow_3_1::ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(n = 1, stress_ρ = 2, stress_g = 3, stress_A = 4:12)}}}, primal_4::Float64, shadow_4_1::Base.RefValue{Float64})
@ Enzyme.Compiler ~/.julia/packages/Enzyme/azJki/src/rules/jitrules.jl:483
[13] steploss
@ ~/Desktop/askem/mwe.jl:126 [inlined]
[14] steploss
@ ~/Desktop/askem/mwe.jl:0 [inlined]
[15] diffejulia_steploss_13475_inner_1wrap
@ ~/Desktop/askem/mwe.jl:0
[16] macro expansion
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:8369 [inlined]
[17] enzyme_call
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7932 [inlined]
[18] CombinedAdjointThunk
@ ~/.julia/packages/Enzyme/azJki/src/compiler.jl:7705 [inlined]
[19] autodiff
@ ~/.julia/packages/Enzyme/azJki/src/Enzyme.jl:491 [inlined]
[20] autodiff
@ ~/.julia/packages/Enzyme/azJki/src/Enzyme.jl:537 [inlined]
[21] autodiff(::ReverseMode{false, false, FFIABI, false, false}, ::typeof(steploss), ::Duplicated{ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(dynamics_h = 1:10,)}}}}, ::Duplicated{ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(dynamics_h = 1:10,)}}}})
@ Enzyme ~/.julia/packages/Enzyme/azJki/src/Enzyme.jl:504
[22] top-level scope
@ ~/Desktop/askem/mwe.jl:138
[23] eval
@ ./boot.jl:385 [inlined]
[24] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:2076
[25] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
@ Base ./essentials.jl:892
[26] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base ./essentials.jl:889
[27] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/eval.jl:271
[28] (::VSCodeServer.var"#69#74"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/eval.jl:181
[29] withpath(f::VSCodeServer.var"#69#74"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/repl.jl:276
[30] (::VSCodeServer.var"#68#73"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/eval.jl:179
[31] hideprompt(f::VSCodeServer.var"#68#73"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/repl.jl:38
[32] (::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/eval.jl:150
[33] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:515
[34] with_logger
@ ./logging.jl:627 [inlined]
[35] (::VSCodeServer.var"#66#71"{VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/eval.jl:263
[36] #invokelatest#2
@ ./essentials.jl:892 [inlined]
[37] invokelatest(::Any)
@ Base ./essentials.jl:889
[38] (::VSCodeServer.var"#64#65")()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.127.2/scripts/packages/VSCodeServer/src/eval.jl:34
in expression starting at /Users/chrisrackauckas/Desktop/askem/mwe.jl:138 Looks like it is due to |
@jpfairbanks Can you highlight where the sparse matrix is used here? It looks like it's a missing rule in Enzyme EnzymeAD/Enzyme.jl#2013 |
what's the full types of the method match failure? And what version of enzyme are you using (it is the latest)? |
I gave the full types above augmented_primal(::EnzymeCore.EnzymeRules.RevConfigWidth{1, true, true, (false, true, true, false, false, false), false}, ::Const{typeof(mul!)}, ::Type{Duplicated{Vector{Float64}}}, ::Duplicated{Vector{Float64}}, ::Duplicated{SparseMatrixCSC{Int8, Int32}}, ::Duplicated{SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}}, ::Const{Bool}, ::Const{Bool}) and I'm using master. @jpfairbanks will need to pitch in to find out where it is in the code here though. |
Hm is there a way to see the matched vs not matched types ? I don’t know why that’s not in your log. In any case an example of what’s not hit would be useful |
@jClugstor can you try EnzymeAD/Enzyme.jl#2109 on here? |
Will do. |
This is the result of ERROR: Constant memory is stored (or returned) to a differentiable variable.
As a result, Enzyme cannot provably ensure correctness and throws this error.
This might be due to the use of a constant variable as temporary storage for active memory (https://enzyme.mit.edu/julia/stable/faq/#Runtime-Activity).
If Enzyme should be able to prove this use non-differentable, open an issue!
To work around this issue, either:
a) rewrite this variable to not be conditionally active (fastest, but requires a code change), or
b) set the Enzyme mode to turn on runtime activity (e.g. autodiff(set_runtime_activity(Reverse), ...) ). This will maintain correctness, but may slightly reduce performance.
Mismatched activity for: store {} addrspace(10)* %unbox.unpack.unpack, {} addrspace(10)* addrspace(10)* %.fca.0.0.0.0.gep317, align 8, !dbg !527, !noalias !468 const val: %unbox.unpack.unpack = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %unbox.unpack.elt, align 8, !dbg !504, !tbaa !63, !alias.scope !78, !noalias !81, !enzyme_type !453
value=Unknown object of type var"#f#36"{PreallocationTools.FixedSizeDiffCache{Vector{Float64}, Vector{ForwardDiff.Dual{nothing, Float64, 10}}}, PreallocationTools.FixedSizeDiffCache{Vector{Float64}, Vector{ForwardDiff.Dual{nothing, Float64, 9}}}, PreallocationTools.FixedSizeDiffCache{Vector{Float64}, Vector{ForwardDiff.Dual{nothing, Float64, 9}}}, PreallocationTools.FixedSizeDiffCache{Vector{Float64}, Vector{ForwardDiff.Dual{nothing, Float64, 9}}}, SparseMatrixCSC{Float64, Int64}, var"#22#31"{var"#21#30"}, var"#22#31"{var"#14#23"{EmbeddedDeltaDualComplex1D{Bool, Float64, GeometryBasics.Point{2, Float64}}}}, Decapodes.var"#37#38"{SparseMatrixCSC{Float64, Int32}}, SparseMatrixCSC{Int8, Int32}}
llvalue={ [3 x {} addrspace(10)*], [3 x {} addrspace(10)*], [3 x {} addrspace(10)*], [3 x {} addrspace(10)*], { i64, i64, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)* }, [1 x [1 x { [7 x {} addrspace(10)*], { { [2 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [2 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [2 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [2 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] }, { [2 x {} addrspace(10)*] } } }]], [1 x { i64, i64, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)* }], { i64, i64, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)* } } addrspace(11)* %0
Stacktrace:
[1] collect_similar
@ ./array.jl:763
[2] map
@ ./abstractarray.jl:3285
[3] #14
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:74
[4] #22
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:94
[5] f
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/ice_sheet1D_alloc.jl:56
Stacktrace:
[1] collect_similar
@ ./array.jl:763 [inlined]
[2] map
@ ./abstractarray.jl:3285 [inlined]
[3] #14
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:74 [inlined]
[4] #22
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:94 [inlined]
[5] f
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/ice_sheet1D_alloc.jl:56
[6] ODEFunction
@ ~/.julia/packages/SciMLBase/NtgCQ/src/scimlfunctions.jl:2358 [inlined]
[7] ODEFunction
@ ~/.julia/packages/SciMLBase/NtgCQ/src/scimlfunctions.jl:0 [inlined]
[8] augmented_julia_ODEFunction_20458_inner_1wrap
@ ~/.julia/packages/SciMLBase/NtgCQ/src/scimlfunctions.jl:0
[9] macro expansion
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:8398 [inlined]
[10] enzyme_call
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7950 [inlined]
[11] AugmentedForwardThunk
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7787 [inlined]
[12] runtime_generic_augfwd(activity::Type{…}, runtimeActivity::Val{…}, width::Val{…}, ModifiedBetween::Val{…}, RT::Val{…}, f::ODEFunction{…}, df::ODEFunction{…}, primal_1::ComponentVector{…}, shadow_1_1::ComponentVector{…}, primal_2::ComponentVector{…}, shadow_2_1::ComponentVector{…}, primal_3::ComponentVector{…}, shadow_3_1::ComponentVector{…}, primal_4::Float64, shadow_4_1::Base.RefValue{…})
@ Enzyme.Compiler ~/Documents/Work/dev/Enzyme.jl/src/rules/jitrules.jl:484
[13] steploss
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:127 [inlined]
[14] steploss
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:0 [inlined]
[15] diffejulia_steploss_15586_inner_1wrap
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:0
[16] macro expansion
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:8398 [inlined]
[17] enzyme_call
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7950 [inlined]
[18] CombinedAdjointThunk
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7723 [inlined]
[19] autodiff
@ ~/Documents/Work/dev/Enzyme.jl/src/Enzyme.jl:491 [inlined]
[20] autodiff
@ ~/Documents/Work/dev/Enzyme.jl/src/Enzyme.jl:537 [inlined]
[21] autodiff(::ReverseMode{…}, ::typeof(steploss), ::Duplicated{…}, ::Duplicated{…})
@ Enzyme ~/Documents/Work/dev/Enzyme.jl/src/Enzyme.jl:504
[22] top-level scope
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:137
Some type information was truncated. Use `show(err)` to see complete types.
|
We have had performance problems regarding the Val{Symbol} and constant propagation in incident and getindex like that before. We can replace that dispatch on symbol with a dispatch on singleton structs to make that more robust, but it would be a fairly large change to ACSets.jl to make that work with the existing system. Sparse matrices are used throughout each of the component operators are based on generating a sparse matrix at while constructing the closure and then just using mul! during the closure. |
@jClugstor try setting runtime activity and see what we're at. Enzyme.autodiff(set_runtime_activity(Reverse), steploss, Duplicated(du, d_du), Duplicated(u,d_u)) |
If it's type stable it shouldn't be an issue? Dispatch on singleton structs and dispatch on Val{Symbol} should be the same. You mean |
With ERROR: Enzyme cannot deduce type
Current scope:
; Function Attrs: mustprogress willreturn
define internal fastcc void @preprocess_julia__19_20402([1 x [2 x double]]* noalias nocapture noundef nonnull writeonly sret([1 x [2 x double]]) align 8 dereferenceable(16) "enzyme_type"="{[-1]:Pointer, [-1,-1]:Float@double}" %0, [1 x {} addrspace(10)*] addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,0]:Pointer, [-1,0,0,-1]:Float@double, [-1,0,8]:Integer, [-1,0,9]:Integer, [-1,0,10]:Integer, [-1,0,11]:Integer, [-1,0,12]:Integer, [-1,0,13]:Integer, [-1,0,14]:Integer, [-1,0,15]:Integer, [-1,0,16]:Integer, [-1,0,17]:Integer, [-1,0,18]:Integer, [-1,0,19]:Integer, [-1,0,20]:Integer, [-1,0,21]:Integer, [-1,0,22]:Integer, [-1,0,23]:Integer, [-1,0,24]:Integer, [-1,0,25]:Integer, [-1,0,26]:Integer, [-1,0,27]:Integer, [-1,0,28]:Integer, [-1,0,29]:Integer, [-1,0,30]:Integer, [-1,0,31]:Integer, [-1,0,32]:Integer, [-1,0,33]:Integer, [-1,0,34]:Integer, [-1,0,35]:Integer, [-1,0,36]:Integer, [-1,0,37]:Integer, [-1,0,38]:Integer, [-1,0,39]:Integer}" "enzymejl_parmtype"="130277337214864" "enzymejl_parmtype_ref"="1" %1, {} addrspace(10)* nocapture noundef nonnull readonly align 16 dereferenceable(40) "enzyme_inactive" "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Integer, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" "enzymejl_parmtype"="130282548130944" "enzymejl_parmtype_ref"="2" %2, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" "enzymejl_parmtype"="130278794734512" "enzymejl_parmtype_ref"="2" %3) unnamed_addr #80 !dbg !4712 {
top:
%4 = call {}*** @julia.get_pgcstack()
%5 = bitcast {}*** %4 to {}**
%6 = getelementptr inbounds {}*, {}** %5, i64 -14
%7 = getelementptr inbounds {}*, {}** %6, i64 16
%8 = bitcast {}** %7 to i8**
%9 = load i8*, i8** %8, align 8
%10 = call noalias nonnull dereferenceable(24) dereferenceable_or_null(24) {} addrspace(10)* @jl_gc_alloc_typed(i8* %9, i64 24, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 130277802531216 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !322
call void @zeroType.26({} addrspace(10)* %10, i8 0, i64 24), !enzyme_zerostack !0
%11 = bitcast {} addrspace(10)* %10 to { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)*, !enzyme_caststack !0
%12 = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16), !enzyme_fromstack !322
%13 = bitcast i8* %12 to [1 x [2 x double]]*, !enzyme_caststack !0
%14 = call {}*** @julia.get_pgcstack() #126
%ptls_field199 = getelementptr inbounds {}**, {}*** %14, i64 2
%15 = bitcast {}*** %ptls_field199 to i64***
%ptls_load200201 = load i64**, i64*** %15, align 8, !tbaa !84
%16 = getelementptr inbounds i64*, i64** %ptls_load200201, i64 2
%safepoint = load i64*, i64** %16, align 8, !tbaa !88
fence syncscope("singlethread") seq_cst
call void @julia.safepoint(i64* %safepoint) #126, !dbg !4713
fence syncscope("singlethread") seq_cst
%getfield_addr = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(11)* %1, i64 0, i64 0, !dbg !4713
%getfield = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %getfield_addr unordered, align 8, !dbg !4713, !tbaa !88, !alias.scope !106, !noalias !109, !nonnull !0, !dereferenceable !156, !align !157, !enzyme_type !158, !enzymejl_byref_MUT_REF !0, !enzymejl_source_type_Vector\7BFloat64\7D !0
%.fca.0.0.gep = getelementptr { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11, i64 0, i32 0, i64 0, !dbg !4713
store {} addrspace(10)* %getfield, {} addrspace(10)* addrspace(10)* %.fca.0.0.gep, align 8, !dbg !4713, !noalias !4714
call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* %10, {} addrspace(10)* %getfield), !dbg !4713
%.fca.1.0.0.gep = getelementptr { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11, i64 0, i32 1, i64 0, i64 0, !dbg !4713
store {} addrspace(10)* %2, {} addrspace(10)* addrspace(10)* %.fca.1.0.0.gep, align 8, !dbg !4713, !noalias !4714
call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* %10, {} addrspace(10)* %2), !dbg !4713
%.fca.1.0.1.gep = getelementptr { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11, i64 0, i32 1, i64 0, i64 1, !dbg !4713
store {} addrspace(10)* %3, {} addrspace(10)* addrspace(10)* %.fca.1.0.1.gep, align 8, !dbg !4713, !noalias !4714
call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* %10, {} addrspace(10)* %3), !dbg !4713
%17 = addrspacecast { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11 to { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(11)*, !dbg !4713
%18 = call fastcc nonnull {} addrspace(10)* @julia_collect_20415({ [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(24) %17) #126, !dbg !4713
%19 = addrspacecast {} addrspace(10)* %18 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !4717
%arraylen_ptr = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %19, i64 0, i32 1, !dbg !4717
%arraylen = load i64, i64 addrspace(11)* %arraylen_ptr, align 8, !dbg !4717, !tbaa !122, !range !125, !alias.scope !126, !noalias !127
switch i64 %arraylen, label %L19 [
i64 0, label %L59
i64 1, label %idxend85
], !dbg !4730
L19: ; preds = %top
%20 = icmp ugt i64 %arraylen, 15, !dbg !4731
br i1 %20, label %L55, label %idxend103, !dbg !4732
L55: ; preds = %L19
call fastcc void @julia_mapreduce_impl_20409([1 x [2 x double]]* noalias nocapture nofree noundef nonnull writeonly sret([1 x [2 x double]]) align 8 dereferenceable(16) %13, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %18, i64 noundef signext 1, i64 signext %arraylen) #126, !dbg !4733
%.sroa.0175.0..sroa_idx183 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %13, i64 0, i64 0, i64 0, !dbg !4713
%.sroa.0175.0.copyload184 = load double, double* %.sroa.0175.0..sroa_idx183, align 8, !dbg !4713, !tbaa !480, !alias.scope !482, !noalias !4735
%.sroa.10.0..sroa_idx193 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %13, i64 0, i64 0, i64 1, !dbg !4713
%.sroa.10.0.copyload194 = load double, double* %.sroa.10.0..sroa_idx193, align 8, !dbg !4713, !tbaa !480, !alias.scope !482, !noalias !4735
br label %L59
L59.loopexit.unr-lcssa.loopexit: ; preds = %idxend122
br label %L59.loopexit.unr-lcssa, !dbg !4736
L59.loopexit.unr-lcssa: ; preds = %L59.loopexit.unr-lcssa.loopexit, %idxend122.preheader
%.lcssa262.ph = phi double [ undef, %idxend122.preheader ], [ %130, %L59.loopexit.unr-lcssa.loopexit ]
%.lcssa261.ph = phi double [ undef, %idxend122.preheader ], [ %131, %L59.loopexit.unr-lcssa.loopexit ]
%value_phi115240.unr = phi i64 [ 2, %idxend122.preheader ], [ %129, %L59.loopexit.unr-lcssa.loopexit ]
%value_phi114239.unr = phi double [ %101, %idxend122.preheader ], [ %131, %L59.loopexit.unr-lcssa.loopexit ]
%value_phi113238.unr = phi double [ %100, %idxend122.preheader ], [ %130, %L59.loopexit.unr-lcssa.loopexit ]
%lcmp.mod266.not = icmp eq i64 %xtraiter264, 0, !dbg !4736
br i1 %lcmp.mod266.not, label %L59, label %idxend122.epil.preheader, !dbg !4736
idxend122.epil.preheader: ; preds = %L59.loopexit.unr-lcssa
br label %idxend122.epil, !dbg !4736
idxend122.epil: ; preds = %idxend122.epil.preheader, %idxend122.epil
%iv1 = phi i64 [ 0, %idxend122.epil.preheader ], [ %iv.next2, %idxend122.epil ]
%value_phi114239.epil = phi double [ %24, %idxend122.epil ], [ %value_phi114239.unr, %idxend122.epil.preheader ]
%value_phi113238.epil = phi double [ %23, %idxend122.epil ], [ %value_phi113238.unr, %idxend122.epil.preheader ]
%21 = add nuw nsw i64 %value_phi115240.unr, %iv1, !dbg !4737
%iv.next2 = add nuw nsw i64 %iv1, 1, !dbg !4737
%22 = add nuw nsw i64 %21, 1, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.epil = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %21, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.epil = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.epil, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.epil = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %21, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.epil = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.epil, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%23 = fadd double %value_phi113238.epil, %arrayref125.sroa.0.0.copyload.epil, !dbg !4741
%24 = fadd double %value_phi114239.epil, %arrayref125.sroa.2.0.copyload.epil, !dbg !4741
%epil.iter265.cmp.not = icmp eq i64 %iv.next2, %xtraiter264, !dbg !4736
br i1 %epil.iter265.cmp.not, label %L59.loopexit, label %idxend122.epil, !dbg !4736, !llvm.loop !4748
L59.loopexit: ; preds = %idxend122.epil
br label %L59, !dbg !4749
L59: ; preds = %L59.loopexit, %idxend103, %idxend85, %L59.loopexit.unr-lcssa, %L55, %top
%.sroa.0175.0 = phi double [ %.sroa.0175.0.copyload184, %L55 ], [ %arrayref88.sroa.0.0.copyload, %idxend85 ], [ 0.000000e+00, %top ], [ %100, %idxend103 ], [ %.lcssa262.ph, %L59.loopexit.unr-lcssa ], [ %23, %L59.loopexit ]
%.sroa.10.0 = phi double [ %.sroa.10.0.copyload194, %L55 ], [ %arrayref88.sroa.2.0.copyload, %idxend85 ], [ 0.000000e+00, %top ], [ %101, %idxend103 ], [ %.lcssa261.ph, %L59.loopexit.unr-lcssa ], [ %24, %L59.loopexit ]
%25 = addrspacecast {} addrspace(10)* %3 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !4749
%arraylen_ptr2 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %25, i64 0, i32 1, !dbg !4749
%arraylen3 = load i64, i64 addrspace(11)* %arraylen_ptr2, align 8, !dbg !4749, !tbaa !122, !range !125, !alias.scope !126, !noalias !127, !enzyme_type !128, !enzyme_inactive !0, !enzymejl_source_type_UInt64 !0, !enzymejl_byref_BITS_VALUE !0
%26 = call noalias nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 130282549281632 to {}*) to {} addrspace(10)*), i64 %arraylen3) #127, !dbg !4756
%.not203 = icmp eq i64 %arraylen3, 0, !dbg !4762
br i1 %.not203, label %L59.L180_crit_edge, label %L95.lr.ph, !dbg !4763
L59.L180_crit_edge: ; preds = %L59
%.phi.trans.insert = addrspacecast {} addrspace(10)* %26 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*
%arraylen_ptr32.phi.trans.insert = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %.phi.trans.insert, i64 0, i32 1
%arraylen33.pre = load i64, i64 addrspace(11)* %arraylen_ptr32.phi.trans.insert, align 8, !dbg !4717, !tbaa !122, !range !125, !alias.scope !126, !noalias !127, !enzyme_type !128, !enzyme_inactive !0, !enzymejl_source_type_UInt64 !0, !enzymejl_byref_BITS_VALUE !0
br label %L180, !dbg !4763
L95.lr.ph: ; preds = %L59
%27 = addrspacecast {} addrspace(10)* %3 to [1 x [2 x double]] addrspace(13)* addrspace(11)*
%arrayptr206 = load [1 x [2 x double]] addrspace(13)*, [1 x [2 x double]] addrspace(13)* addrspace(11)* %27, align 16, !tbaa !141, !alias.scope !4765, !noalias !127, !nonnull !0, !enzyme_type !174, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BGeometryBasics.Point\7B2\2C\20Float64\7D\7D !0
%28 = addrspacecast {} addrspace(10)* %26 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*
%arraylen_ptr16 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %28, i64 0, i32 1
%29 = addrspacecast {} addrspace(10)* %26 to double addrspace(13)* addrspace(11)*
br label %idxend, !dbg !4766
L131: ; preds = %idxend
%30 = call double @llvm.fabs.f64(double %arrayref.sroa.0.0.copyload) #126, !dbg !4767
%31 = call double @llvm.fabs.f64(double %arrayref.sroa.5.0.copyload) #126, !dbg !4778
%32 = fsub double %30, %31, !dbg !4781
%bitcast_coercion = bitcast double %32 to i64, !dbg !4783
%33 = icmp slt i64 %bitcast_coercion, 0, !dbg !4785
%34 = select i1 %33, double %31, double %30, !dbg !4785
%35 = fcmp ord double %arrayref.sroa.0.0.copyload, %arrayref.sroa.5.0.copyload, !dbg !4786
%36 = select i1 %35, double %34, double %32, !dbg !4788
%37 = fsub double %36, %36, !dbg !4790
%38 = fcmp ord double %37, 0.000000e+00, !dbg !4793
br i1 %38, label %L154, label %L174, !dbg !4792
L154: ; preds = %L131
%39 = fcmp une double %36, 0.000000e+00, !dbg !4795
br i1 %39, label %L157, label %L174, !dbg !4797
L157: ; preds = %L154
%40 = fdiv double %arrayref.sroa.0.0.copyload, %36, !dbg !4798
%41 = fmul double %40, %40, !dbg !4800
%42 = fdiv double %arrayref.sroa.5.0.copyload, %36, !dbg !4798
%43 = fmul double %42, %42, !dbg !4800
%44 = fadd double %41, %43, !dbg !4803
%45 = call double @julia_sqrt_20345(double %44) #128, !dbg !4799
%46 = fmul double %36, %45, !dbg !4804
br label %L174, !dbg !4799
L174: ; preds = %idxend, %L157, %L154, %L131
%value_phi15 = phi double [ %46, %L157 ], [ %36, %L131 ], [ 0.000000e+00, %L154 ], [ %58, %idxend ]
%arraylen17 = load i64, i64 addrspace(11)* %arraylen_ptr16, align 8, !dbg !4805, !tbaa !122, !range !125, !alias.scope !126, !noalias !127, !enzyme_type !128, !enzyme_inactive !0, !enzymejl_source_type_UInt64 !0, !enzymejl_byref_BITS_VALUE !0
%inbounds18 = icmp ult i64 %iv3, %arraylen17, !dbg !4805
br i1 %inbounds18, label %idxend21, label %oob19, !dbg !4805
L180.loopexit: ; preds = %idxend21
br label %L180, !dbg !4730
L180: ; preds = %L180.loopexit, %L59.L180_crit_edge
%arraylen33 = phi i64 [ %arraylen33.pre, %L59.L180_crit_edge ], [ %arraylen17, %L180.loopexit ], !dbg !4717, !enzyme_inactive !0
switch i64 %arraylen33, label %L192 [
i64 0, label %L222
i64 1, label %idxend45
], !dbg !4730
L192: ; preds = %L180
%47 = icmp ugt i64 %arraylen33, 15, !dbg !4731
br i1 %47, label %L208, label %idxend63, !dbg !4732
L208: ; preds = %L192
%48 = call fastcc double @julia_mapreduce_impl_20412({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %26, i64 noundef signext 1, i64 signext %arraylen33) #126, !dbg !4733
br label %L222, !dbg !4734
L222.loopexit.unr-lcssa.loopexit: ; preds = %idxend75
br label %L222.loopexit.unr-lcssa, !dbg !4736
L222.loopexit.unr-lcssa: ; preds = %L222.loopexit.unr-lcssa.loopexit, %idxend75.preheader
%.lcssa.ph = phi double [ undef, %idxend75.preheader ], [ %97, %L222.loopexit.unr-lcssa.loopexit ]
%value_phi68234.unr = phi i64 [ 2, %idxend75.preheader ], [ %95, %L222.loopexit.unr-lcssa.loopexit ]
%value_phi67233.unr = phi double [ %67, %idxend75.preheader ], [ %97, %L222.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0, !dbg !4736
br i1 %lcmp.mod.not, label %L222, label %idxend75.epil.preheader, !dbg !4736
idxend75.epil.preheader: ; preds = %L222.loopexit.unr-lcssa
br label %idxend75.epil, !dbg !4736
idxend75.epil: ; preds = %idxend75.epil.preheader, %idxend75.epil
%iv7 = phi i64 [ 0, %idxend75.epil.preheader ], [ %iv.next8, %idxend75.epil ]
%value_phi67233.epil = phi double [ %52, %idxend75.epil ], [ %value_phi67233.unr, %idxend75.epil.preheader ]
%49 = add nuw nsw i64 %value_phi68234.unr, %iv7, !dbg !4737
%iv.next8 = add nuw nsw i64 %iv7, 1, !dbg !4737
%50 = add nuw nsw i64 %49, 1, !dbg !4737
%51 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %49, !dbg !4739
%arrayref78.epil = load double, double addrspace(13)* %51, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%52 = fadd double %value_phi67233.epil, %arrayref78.epil, !dbg !4807
%epil.iter.cmp.not = icmp eq i64 %iv.next8, %xtraiter, !dbg !4736
br i1 %epil.iter.cmp.not, label %L222.loopexit, label %idxend75.epil, !dbg !4736, !llvm.loop !4809
L222.loopexit: ; preds = %idxend75.epil
br label %L222, !dbg !4810
L222: ; preds = %L222.loopexit, %idxend63, %idxend45, %L222.loopexit.unr-lcssa, %L208, %L180
%value_phi35 = phi double [ %arrayref48, %idxend45 ], [ %48, %L208 ], [ 0.000000e+00, %L180 ], [ %67, %idxend63 ], [ %.lcssa.ph, %L222.loopexit.unr-lcssa ], [ %52, %L222.loopexit ]
%53 = fdiv double %.sroa.0175.0, %value_phi35, !dbg !4810
%54 = fdiv double %.sroa.10.0, %value_phi35, !dbg !4810
%newstruct39.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %0, i64 0, i64 0, i64 0, !dbg !4812
store double %53, double* %newstruct39.sroa.0.0..sroa_idx, align 8, !dbg !4812, !noalias !4714
%newstruct39.sroa.2.0..sroa_idx171 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %0, i64 0, i64 0, i64 1, !dbg !4812
store double %54, double* %newstruct39.sroa.2.0..sroa_idx171, align 8, !dbg !4812, !noalias !4714
ret void, !dbg !4812
idxend: ; preds = %idxend21, %L95.lr.ph
%iv3 = phi i64 [ %iv.next4, %idxend21 ], [ 0, %L95.lr.ph ]
%iv.next4 = add nuw nsw i64 %iv3, 1, !dbg !4816
%arrayref.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr206, i64 %iv3, i64 0, i64 0, !dbg !4819
%arrayref.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref.sroa.0.0..sroa_idx, align 1, !dbg !4819, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref.sroa.5.0..sroa_idx172 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr206, i64 %iv3, i64 0, i64 1, !dbg !4819
%arrayref.sroa.5.0.copyload = load double, double addrspace(13)* %arrayref.sroa.5.0..sroa_idx172, align 1, !dbg !4819, !tbaa !611, !alias.scope !919, !noalias !4740
%55 = fmul double %arrayref.sroa.0.0.copyload, %arrayref.sroa.0.0.copyload, !dbg !4823
%56 = fmul double %arrayref.sroa.5.0.copyload, %arrayref.sroa.5.0.copyload, !dbg !4823
%57 = fadd double %55, %56, !dbg !4827
%58 = call double @julia_sqrt_20345(double %57) #128, !dbg !4826
%59 = fcmp ule double %58, 0.000000e+00, !dbg !4828
%60 = fsub double %58, %58
%61 = fcmp uno double %60, 0.000000e+00
%or.cond = or i1 %59, %61, !dbg !4829
br i1 %or.cond, label %L131, label %L174, !dbg !4829
oob19: ; preds = %L174
%errorbox20 = alloca i64, align 8, !dbg !4805
store i64 %iv.next4, i64* %errorbox20, align 8, !dbg !4805, !noalias !4714
%62 = addrspacecast {} addrspace(10)* %26 to {} addrspace(12)*, !dbg !4805
call void @ijl_bounds_error_ints({} addrspace(12)* %62, i64* nonnull align 8 %errorbox20, i64 1) #126, !dbg !4805
unreachable, !dbg !4805
idxend21: ; preds = %L174
%arrayptr23207 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %29, align 8, !dbg !4805, !tbaa !141, !alias.scope !4765, !noalias !127, !nonnull !0, !enzyme_type !174, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0
%63 = getelementptr inbounds double, double addrspace(13)* %arrayptr23207, i64 %iv3, !dbg !4805
store double %value_phi15, double addrspace(13)* %63, align 8, !dbg !4805, !tbaa !147, !alias.scope !150, !noalias !4830
%exitcond249.not = icmp eq i64 %iv.next4, %arraylen3, !dbg !4831
br i1 %exitcond249.not, label %L180.loopexit, label %idxend, !dbg !4766, !llvm.loop !4832
idxend45: ; preds = %L180
%64 = addrspacecast {} addrspace(10)* %26 to double addrspace(13)* addrspace(11)*, !dbg !4833
%arrayptr47210 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %64, align 8, !dbg !4833, !tbaa !141, !alias.scope !4765, !noalias !127, !nonnull !0, !enzyme_type !174, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0
%arrayref48 = load double, double addrspace(13)* %arrayptr47210, align 8, !dbg !4833, !tbaa !147, !alias.scope !150, !noalias !151, !enzyme_type !1062, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Float64 !0
br label %L222, !dbg !4835
idxend63: ; preds = %L192
%65 = addrspacecast {} addrspace(10)* %26 to double addrspace(13)* addrspace(11)*, !dbg !4836
%arrayptr56211 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %65, align 8, !dbg !4836, !tbaa !141, !alias.scope !4765, !noalias !127, !nonnull !0, !enzyme_type !174, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0
%arrayref57 = load double, double addrspace(13)* %arrayptr56211, align 8, !dbg !4836, !tbaa !147, !alias.scope !150, !noalias !151, !enzyme_type !1062, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Float64 !0
%66 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 1, !dbg !4838
%arrayref66 = load double, double addrspace(13)* %66, align 8, !dbg !4838, !tbaa !147, !alias.scope !150, !noalias !151, !enzyme_type !1062, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Float64 !0
%67 = fadd double %arrayref57, %arrayref66, !dbg !4840
%.not212232 = icmp ugt i64 %arraylen33, 2, !dbg !4843
br i1 %.not212232, label %idxend75.preheader, label %L222, !dbg !4736
idxend75.preheader: ; preds = %idxend63
%68 = add nsw i64 %arraylen33, -2, !dbg !4736
%69 = add nsw i64 %arraylen33, -3, !dbg !4736
%xtraiter = and i64 %68, 7, !dbg !4736
%70 = icmp ult i64 %69, 7, !dbg !4736
br i1 %70, label %L222.loopexit.unr-lcssa, label %idxend75.preheader.new, !dbg !4736
idxend75.preheader.new: ; preds = %idxend75.preheader
%unroll_iter = and i64 %68, -8, !dbg !4736
br label %idxend75, !dbg !4736
idxend75: ; preds = %idxend75, %idxend75.preheader.new
%iv5 = phi i64 [ %iv.next6, %idxend75 ], [ 0, %idxend75.preheader.new ]
%value_phi67233 = phi double [ %67, %idxend75.preheader.new ], [ %97, %idxend75 ]
%71 = shl nuw i64 %iv5, 3, !dbg !4737
%iv.next6 = add nuw nsw i64 %iv5, 1, !dbg !4737
%72 = shl i64 %iv5, 3, !dbg !4737
%73 = add nuw nsw i64 %72, 2, !dbg !4737
%74 = or i64 %73, 1, !dbg !4737
%75 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %73, !dbg !4739
%arrayref78 = load double, double addrspace(13)* %75, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%76 = fadd double %value_phi67233, %arrayref78, !dbg !4807
%77 = add nuw nsw i64 %73, 2, !dbg !4737
%78 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %74, !dbg !4739
%arrayref78.1 = load double, double addrspace(13)* %78, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%79 = fadd double %76, %arrayref78.1, !dbg !4807
%80 = add nuw nsw i64 %73, 3, !dbg !4737
%81 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %77, !dbg !4739
%arrayref78.2 = load double, double addrspace(13)* %81, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%82 = fadd double %79, %arrayref78.2, !dbg !4807
%83 = add nuw nsw i64 %73, 4, !dbg !4737
%84 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %80, !dbg !4739
%arrayref78.3 = load double, double addrspace(13)* %84, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%85 = fadd double %82, %arrayref78.3, !dbg !4807
%86 = add nuw nsw i64 %73, 5, !dbg !4737
%87 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %83, !dbg !4739
%arrayref78.4 = load double, double addrspace(13)* %87, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%88 = fadd double %85, %arrayref78.4, !dbg !4807
%89 = add nuw nsw i64 %73, 6, !dbg !4737
%90 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %86, !dbg !4739
%arrayref78.5 = load double, double addrspace(13)* %90, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%91 = fadd double %88, %arrayref78.5, !dbg !4807
%92 = add nuw nsw i64 %73, 7, !dbg !4737
%93 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %89, !dbg !4739
%arrayref78.6 = load double, double addrspace(13)* %93, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%94 = fadd double %91, %arrayref78.6, !dbg !4807
%95 = add nuw nsw i64 %73, 8, !dbg !4737
%96 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %92, !dbg !4739
%arrayref78.7 = load double, double addrspace(13)* %96, align 8, !dbg !4739, !tbaa !147, !alias.scope !150, !noalias !151
%97 = fadd double %94, %arrayref78.7, !dbg !4807
%niter.next.7 = add i64 %71, 8, !dbg !4736
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter, !dbg !4736
br i1 %niter.ncmp.7, label %L222.loopexit.unr-lcssa.loopexit, label %idxend75, !dbg !4736
idxend85: ; preds = %top
%98 = addrspacecast {} addrspace(10)* %18 to i8 addrspace(13)* addrspace(11)*, !dbg !4833
%arrayptr87214215 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(11)* %98, align 8, !dbg !4833, !tbaa !141, !alias.scope !4765, !noalias !127, !nonnull !0
%arrayref88.sroa.0.0.arrayptr87214215.sroa_cast = bitcast i8 addrspace(13)* %arrayptr87214215 to double addrspace(13)*, !dbg !4833
%arrayref88.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref88.sroa.0.0.arrayptr87214215.sroa_cast, align 1, !dbg !4833, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref88.sroa.2.0.arrayptr87214215.sroa_idx = getelementptr inbounds i8, i8 addrspace(13)* %arrayptr87214215, i64 8, !dbg !4833
%arrayref88.sroa.2.0.arrayptr87214215.sroa_cast = bitcast i8 addrspace(13)* %arrayref88.sroa.2.0.arrayptr87214215.sroa_idx to double addrspace(13)*, !dbg !4833
%arrayref88.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref88.sroa.2.0.arrayptr87214215.sroa_cast, align 1, !dbg !4833, !tbaa !611, !alias.scope !919, !noalias !4740
br label %L59
idxend103: ; preds = %L19
%99 = addrspacecast {} addrspace(10)* %18 to [1 x [2 x double]] addrspace(13)* addrspace(11)*, !dbg !4836
%arrayptr96216 = load [1 x [2 x double]] addrspace(13)*, [1 x [2 x double]] addrspace(13)* addrspace(11)* %99, align 8, !dbg !4836, !tbaa !141, !alias.scope !4765, !noalias !127, !nonnull !0
%arrayref97.sroa.2.0..sroa_idx170 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 0, i64 0, i64 1, !dbg !4836
%arrayref97.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref97.sroa.2.0..sroa_idx170, align 1, !dbg !4836, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref97.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 0, i64 0, i64 0, !dbg !4836
%arrayref97.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref97.sroa.0.0..sroa_idx, align 1, !dbg !4836, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref106.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 1, i64 0, i64 0, !dbg !4838
%arrayref106.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref106.sroa.0.0..sroa_idx, align 1, !dbg !4838, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref106.sroa.2.0..sroa_idx169 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 1, i64 0, i64 1, !dbg !4838
%arrayref106.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref106.sroa.2.0..sroa_idx169, align 1, !dbg !4838, !tbaa !611, !alias.scope !919, !noalias !4740
%100 = fadd double %arrayref97.sroa.0.0.copyload, %arrayref106.sroa.0.0.copyload, !dbg !4844
%101 = fadd double %arrayref97.sroa.2.0.copyload, %arrayref106.sroa.2.0.copyload, !dbg !4844
%.not217237 = icmp ugt i64 %arraylen, 2, !dbg !4843
br i1 %.not217237, label %idxend122.preheader, label %L59, !dbg !4736
idxend122.preheader: ; preds = %idxend103
%102 = add nsw i64 %arraylen, -2, !dbg !4736
%103 = add nsw i64 %arraylen, -3, !dbg !4736
%xtraiter264 = and i64 %102, 7, !dbg !4736
%104 = icmp ult i64 %103, 7, !dbg !4736
br i1 %104, label %L59.loopexit.unr-lcssa, label %idxend122.preheader.new, !dbg !4736
idxend122.preheader.new: ; preds = %idxend122.preheader
%unroll_iter269 = and i64 %102, -8, !dbg !4736
br label %idxend122, !dbg !4736
idxend122: ; preds = %idxend122, %idxend122.preheader.new
%iv = phi i64 [ %iv.next, %idxend122 ], [ 0, %idxend122.preheader.new ]
%value_phi114239 = phi double [ %101, %idxend122.preheader.new ], [ %131, %idxend122 ]
%value_phi113238 = phi double [ %100, %idxend122.preheader.new ], [ %130, %idxend122 ]
%105 = shl nuw i64 %iv, 3, !dbg !4737
%iv.next = add nuw nsw i64 %iv, 1, !dbg !4737
%106 = shl i64 %iv, 3, !dbg !4737
%107 = add nuw nsw i64 %106, 2, !dbg !4737
%108 = or i64 %107, 1, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %107, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %107, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%109 = fadd double %value_phi113238, %arrayref125.sroa.0.0.copyload, !dbg !4741
%110 = fadd double %value_phi114239, %arrayref125.sroa.2.0.copyload, !dbg !4741
%111 = add nuw nsw i64 %107, 2, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.1 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %108, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.1 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.1, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.1 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %108, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.1 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.1, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%112 = fadd double %109, %arrayref125.sroa.0.0.copyload.1, !dbg !4741
%113 = fadd double %110, %arrayref125.sroa.2.0.copyload.1, !dbg !4741
%114 = add nuw nsw i64 %107, 3, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.2 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %111, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.2 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.2, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.2 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %111, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.2 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.2, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%115 = fadd double %112, %arrayref125.sroa.0.0.copyload.2, !dbg !4741
%116 = fadd double %113, %arrayref125.sroa.2.0.copyload.2, !dbg !4741
%117 = add nuw nsw i64 %107, 4, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.3 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %114, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.3 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.3, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.3 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %114, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.3 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.3, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%118 = fadd double %115, %arrayref125.sroa.0.0.copyload.3, !dbg !4741
%119 = fadd double %116, %arrayref125.sroa.2.0.copyload.3, !dbg !4741
%120 = add nuw nsw i64 %107, 5, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.4 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %117, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.4 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.4, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.4 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %117, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.4 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.4, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%121 = fadd double %118, %arrayref125.sroa.0.0.copyload.4, !dbg !4741
%122 = fadd double %119, %arrayref125.sroa.2.0.copyload.4, !dbg !4741
%123 = add nuw nsw i64 %107, 6, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.5 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %120, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.5 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.5, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.5 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %120, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.5 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.5, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%124 = fadd double %121, %arrayref125.sroa.0.0.copyload.5, !dbg !4741
%125 = fadd double %122, %arrayref125.sroa.2.0.copyload.5, !dbg !4741
%126 = add nuw nsw i64 %107, 7, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.6 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %123, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.6 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.6, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.6 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %123, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.6 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.6, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%127 = fadd double %124, %arrayref125.sroa.0.0.copyload.6, !dbg !4741
%128 = fadd double %125, %arrayref125.sroa.2.0.copyload.6, !dbg !4741
%129 = add nuw nsw i64 %107, 8, !dbg !4737
%arrayref125.sroa.0.0..sroa_idx.7 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %126, i64 0, i64 0, !dbg !4739
%arrayref125.sroa.0.0.copyload.7 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.7, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%arrayref125.sroa.2.0..sroa_idx158.7 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %126, i64 0, i64 1, !dbg !4739
%arrayref125.sroa.2.0.copyload.7 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.7, align 1, !dbg !4739, !tbaa !611, !alias.scope !919, !noalias !4740
%130 = fadd double %127, %arrayref125.sroa.0.0.copyload.7, !dbg !4741
%131 = fadd double %128, %arrayref125.sroa.2.0.copyload.7, !dbg !4741
%niter270.next.7 = add i64 %105, 8, !dbg !4736
%niter270.ncmp.7 = icmp eq i64 %niter270.next.7, %unroll_iter269, !dbg !4736
br i1 %niter270.ncmp.7, label %L59.loopexit.unr-lcssa.loopexit, label %idxend122, !dbg !4736
}
Type analysis state:
<analysis>
%arraylen_ptr2 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %25, i64 0, i32 1, !dbg !186: {[-1]:Pointer, [-1,0]:Integer, [-1,1]:Integer, [-1,2]:Integer, [-1,3]:Integer, [-1,4]:Integer, [-1,5]:Integer, [-1,6]:Integer, [-1,7]:Integer}, intvals: {}
i64 0: {[-1]:Anything}, intvals: {0,}
%arrayref125.sroa.0.0..sroa_idx.5 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %120, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.5 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.5, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.5 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %120, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.5 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.5, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%124 = fadd double %121, %arrayref125.sroa.0.0.copyload.5, !dbg !168: {[-1]:Float@double}, intvals: {}
%125 = fadd double %122, %arrayref125.sroa.2.0.copyload.5, !dbg !168: {[-1]:Float@double}, intvals: {}
%126 = add nuw nsw i64 %107, 7, !dbg !159: {[-1]:Integer}, intvals: {9,}
%arrayref125.sroa.0.0..sroa_idx.6 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %123, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.6 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.6, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.6 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %123, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.6 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.6, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%127 = fadd double %124, %arrayref125.sroa.0.0.copyload.6, !dbg !168: {[-1]:Float@double}, intvals: {}
%128 = fadd double %125, %arrayref125.sroa.2.0.copyload.6, !dbg !168: {[-1]:Float@double}, intvals: {}
%129 = add nuw nsw i64 %107, 8, !dbg !159: {[-1]:Integer}, intvals: {10,}
%arrayref125.sroa.0.0..sroa_idx.7 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %126, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.7 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.7, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
{}* inttoptr (i64 130277802531216 to {}*): {[-1]:Anything}, intvals: {}
%arrayref66 = load double, double addrspace(13)* %66, align 8, !dbg !334, !tbaa !288, !alias.scope !291, !noalias !292, !enzyme_type !330, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Float64 !0: {[-1]:Float@double}, intvals: {}
%75 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %73, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%67 = fadd double %arrayref57, %arrayref66, !dbg !336: {[-1]:Float@double}, intvals: {}
%.not212232 = icmp ugt i64 %arraylen33, 2, !dbg !339: {[-1]:Integer}, intvals: {}
%arrayref78 = load double, double addrspace(13)* %75, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%76 = fadd double %value_phi67233, %arrayref78, !dbg !293: {[-1]:Float@double}, intvals: {}
%77 = add nuw nsw i64 %73, 2, !dbg !159: {[-1]:Integer}, intvals: {4,}
%78 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %74, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.1 = load double, double addrspace(13)* %78, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%79 = fadd double %76, %arrayref78.1, !dbg !293: {[-1]:Float@double}, intvals: {}
%80 = add nuw nsw i64 %73, 3, !dbg !159: {[-1]:Integer}, intvals: {5,}
%81 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %77, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.2 = load double, double addrspace(13)* %81, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%82 = fadd double %79, %arrayref78.2, !dbg !293: {[-1]:Float@double}, intvals: {}
%83 = add nuw nsw i64 %73, 4, !dbg !159: {[-1]:Integer}, intvals: {6,}
%84 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %80, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.3 = load double, double addrspace(13)* %84, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%85 = fadd double %82, %arrayref78.3, !dbg !293: {[-1]:Float@double}, intvals: {}
%.sroa.0175.0..sroa_idx183 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %13, i64 0, i64 0, i64 0, !dbg !91: {[-1]:Pointer}, intvals: {}
%15 = bitcast {}*** %ptls_field199 to i64***: {[-1]:Pointer, [-1,0]:Pointer}, intvals: {}
%ptls_load200201 = load i64**, i64*** %15, align 8, !tbaa !85: {[-1]:Pointer}, intvals: {}
%safepoint = load i64*, i64** %16, align 8, !tbaa !89: {}, intvals: {}
%getfield = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %getfield_addr unordered, align 8, !dbg !91, !tbaa !89, !alias.scope !92, !noalias !95, !nonnull !0, !dereferenceable !100, !align !101, !enzyme_type !102, !enzymejl_byref_MUT_REF !0, !enzymejl_source_type_Vector\7BFloat64\7D !0: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%18 = call fastcc nonnull {} addrspace(10)* @julia_collect_20415({ [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(24) %17) #126, !dbg !91: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%30 = call double @llvm.fabs.f64(double %arrayref.sroa.0.0.copyload) #126, !dbg !220: {[-1]:Float@double}, intvals: {}
switch i64 %arraylen, label %L19 [
i64 0, label %L59
i64 1, label %idxend85
], !dbg !146: {}, intvals: {}
%.sroa.10.0..sroa_idx193 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %13, i64 0, i64 0, i64 1, !dbg !91: {[-1]:Pointer}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.epil = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %21, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%4 = call {}*** @julia.get_pgcstack(): {[-1]:Pointer}, intvals: {}
i64 7: {[-1]:Integer}, intvals: {7,}
i64 -8: {[-1]:Integer}, intvals: {-8,}
%49 = add nuw nsw i64 %value_phi68234.unr, %iv7, !dbg !159: {[-1]:Integer}, intvals: {2,10,}
%arrayref88.sroa.0.0.arrayptr87214215.sroa_cast = bitcast i8 addrspace(13)* %arrayptr87214215 to double addrspace(13)*, !dbg !328: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref88.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref88.sroa.0.0.arrayptr87214215.sroa_cast, align 1, !dbg !328, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref88.sroa.2.0.arrayptr87214215.sroa_idx = getelementptr inbounds i8, i8 addrspace(13)* %arrayptr87214215, i64 8, !dbg !328: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref88.sroa.2.0.arrayptr87214215.sroa_cast = bitcast i8 addrspace(13)* %arrayref88.sroa.2.0.arrayptr87214215.sroa_idx to double addrspace(13)*, !dbg !328: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref88.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref88.sroa.2.0.arrayptr87214215.sroa_cast, align 1, !dbg !328, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%99 = addrspacecast {} addrspace(10)* %18 to [1 x [2 x double]] addrspace(13)* addrspace(11)*, !dbg !332: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arrayptr96216 = load [1 x [2 x double]] addrspace(13)*, [1 x [2 x double]] addrspace(13)* addrspace(11)* %99, align 8, !dbg !332, !tbaa !215, !alias.scope !217, !noalias !145, !nonnull !0: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref97.sroa.2.0..sroa_idx170 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 0, i64 0, i64 1, !dbg !332: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref97.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref97.sroa.2.0..sroa_idx170, align 1, !dbg !332, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref97.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 0, i64 0, i64 0, !dbg !332: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref97.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref97.sroa.0.0..sroa_idx, align 1, !dbg !332, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref106.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 1, i64 0, i64 0, !dbg !334: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref106.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref106.sroa.0.0..sroa_idx, align 1, !dbg !334, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref106.sroa.2.0..sroa_idx169 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 1, i64 0, i64 1, !dbg !334: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
i64 5: {[-1]:Integer}, intvals: {5,}
%107 = add nuw nsw i64 %106, 2, !dbg !159: {[-1]:Integer}, intvals: {2,}
%arraylen_ptr = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %19, i64 0, i32 1, !dbg !110: {[-1]:Pointer, [-1,0]:Integer, [-1,1]:Integer, [-1,2]:Integer, [-1,3]:Integer, [-1,4]:Integer, [-1,5]:Integer, [-1,6]:Integer, [-1,7]:Integer}, intvals: {}
%or.cond = or i1 %59, %61, !dbg !324: {[-1]:Integer}, intvals: {}
%errorbox20 = alloca i64, align 8, !dbg !285: {}, intvals: {}
%62 = addrspacecast {} addrspace(10)* %26 to {} addrspace(12)*, !dbg !285: {}, intvals: {}
%arrayptr23207 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %29, align 8, !dbg !285, !tbaa !215, !alias.scope !217, !noalias !145, !nonnull !0, !enzyme_type !218, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%63 = getelementptr inbounds double, double addrspace(13)* %arrayptr23207, i64 %iv3, !dbg !285: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%exitcond249.not = icmp eq i64 %iv.next4, %arraylen3, !dbg !326: {[-1]:Integer}, intvals: {}
%64 = addrspacecast {} addrspace(10)* %26 to double addrspace(13)* addrspace(11)*, !dbg !328: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arrayptr47210 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %64, align 8, !dbg !328, !tbaa !215, !alias.scope !217, !noalias !145, !nonnull !0, !enzyme_type !218, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%66 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 1, !dbg !334: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref48 = load double, double addrspace(13)* %arrayptr47210, align 8, !dbg !328, !tbaa !288, !alias.scope !291, !noalias !292, !enzyme_type !330, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Float64 !0: {[-1]:Float@double}, intvals: {}
%65 = addrspacecast {} addrspace(10)* %26 to double addrspace(13)* addrspace(11)*, !dbg !332: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arrayptr56211 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %65, align 8, !dbg !332, !tbaa !215, !alias.scope !217, !noalias !145, !nonnull !0, !enzyme_type !218, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref57 = load double, double addrspace(13)* %arrayptr56211, align 8, !dbg !332, !tbaa !288, !alias.scope !291, !noalias !292, !enzyme_type !330, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Float64 !0: {[-1]:Float@double}, intvals: {}
i64 24: {[-1]:Integer}, intvals: {24,}
%12 = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16), !enzyme_fromstack !84: {[-1]:Pointer}, intvals: {}
i64 4: {[-1]:Integer}, intvals: {4,}
%68 = add nsw i64 %arraylen33, -2, !dbg !158: {[-1]:Integer}, intvals: {}
%69 = add nsw i64 %arraylen33, -3, !dbg !158: {[-1]:Integer}, intvals: {}
%xtraiter = and i64 %68, 7, !dbg !158: {[-1]:Integer}, intvals: {}
%iv = phi i64 [ %iv.next, %idxend122 ], [ 0, %idxend122.preheader.new ]: {[-1]:Integer}, intvals: {0,}
i64 -2: {[-1]:Integer}, intvals: {-2,}
%16 = getelementptr inbounds i64*, i64** %ptls_load200201, i64 2: {[-1]:Pointer}, intvals: {}
i32 1: {[-1]:Integer}, intvals: {1,}
%arrayref125.sroa.2.0.copyload.2 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.2, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%115 = fadd double %112, %arrayref125.sroa.0.0.copyload.2, !dbg !168: {[-1]:Float@double}, intvals: {}
%116 = fadd double %113, %arrayref125.sroa.2.0.copyload.2, !dbg !168: {[-1]:Float@double}, intvals: {}
%117 = add nuw nsw i64 %107, 4, !dbg !159: {[-1]:Integer}, intvals: {6,}
%arrayref125.sroa.0.0..sroa_idx.3 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %114, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.3 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.3, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.3 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %114, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.3 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.3, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%118 = fadd double %115, %arrayref125.sroa.0.0.copyload.3, !dbg !168: {[-1]:Float@double}, intvals: {}
%119 = fadd double %116, %arrayref125.sroa.2.0.copyload.3, !dbg !168: {[-1]:Float@double}, intvals: {}
%120 = add nuw nsw i64 %107, 5, !dbg !159: {[-1]:Integer}, intvals: {7,}
%arrayref125.sroa.0.0..sroa_idx.4 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %117, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.4 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.4, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.4 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %117, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.4 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.4, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%121 = fadd double %118, %arrayref125.sroa.0.0.copyload.4, !dbg !168: {[-1]:Float@double}, intvals: {}
%122 = fadd double %119, %arrayref125.sroa.2.0.copyload.4, !dbg !168: {[-1]:Float@double}, intvals: {}
%123 = add nuw nsw i64 %107, 6, !dbg !159: {[-1]:Integer}, intvals: {8,}
%71 = shl nuw i64 %iv5, 3, !dbg !159: {[-1]:Integer}, intvals: {0,}
%40 = fdiv double %arrayref.sroa.0.0.copyload, %36, !dbg !273: {[-1]:Float@double}, intvals: {}
%41 = fmul double %40, %40, !dbg !276: {[-1]:Float@double}, intvals: {}
%42 = fdiv double %arrayref.sroa.5.0.copyload, %36, !dbg !273: {[-1]:Float@double}, intvals: {}
%43 = fmul double %42, %42, !dbg !276: {[-1]:Float@double}, intvals: {}
%44 = fadd double %41, %43, !dbg !283: {[-1]:Float@double}, intvals: {}
%45 = call double @julia_sqrt_20345(double %44) #128, !dbg !275: {[-1]:Float@double}, intvals: {}
%46 = fmul double %36, %45, !dbg !284: {[-1]:Float@double}, intvals: {}
%value_phi15 = phi double [ %46, %L157 ], [ %36, %L131 ], [ 0.000000e+00, %L154 ], [ %58, %idxend ]: {[-1]:Float@double}, intvals: {}
%arraylen17 = load i64, i64 addrspace(11)* %arraylen_ptr16, align 8, !dbg !285, !tbaa !140, !range !143, !alias.scope !144, !noalias !145, !enzyme_type !200, !enzyme_inactive !0, !enzymejl_source_type_UInt64 !0, !enzymejl_byref_BITS_VALUE !0: {[-1]:Integer}, intvals: {}
%51 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %49, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%inbounds18 = icmp ult i64 %iv3, %arraylen17, !dbg !285: {[-1]:Integer}, intvals: {}
%arraylen33 = phi i64 [ %arraylen33.pre, %L59.L180_crit_edge ], [ %arraylen17, %L180.loopexit ], !dbg !110, !enzyme_inactive !0: {[-1]:Integer}, intvals: {}
switch i64 %arraylen33, label %L192 [
i64 0, label %L222
i64 1, label %idxend45
], !dbg !146: {}, intvals: {}
%47 = icmp ugt i64 %arraylen33, 15, !dbg !147: {[-1]:Integer}, intvals: {}
{}* inttoptr (i64 130282549281632 to {}*): {[-1]:Anything}, intvals: {}
%iv1 = phi i64 [ 0, %idxend122.epil.preheader ], [ %iv.next2, %idxend122.epil ]: {[-1]:Integer}, intvals: {0,}
call void @zeroType.26({} addrspace(10)* %10, i8 0, i64 24), !enzyme_zerostack !0: {}, intvals: {}
%11 = bitcast {} addrspace(10)* %10 to { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)*, !enzyme_caststack !0: {[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double, [-1,8,0,-1]:Integer, [-1,16,0,-1]:Float@double}, intvals: {}
%.fca.0.0.gep = getelementptr { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11, i64 0, i32 0, i64 0, !dbg !91: {[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double}, intvals: {}
%.fca.1.0.0.gep = getelementptr { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11, i64 0, i32 1, i64 0, i64 0, !dbg !91: {[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Integer}, intvals: {}
%.fca.1.0.1.gep = getelementptr { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] }, { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11, i64 0, i32 1, i64 0, i64 1, !dbg !91: {[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0..sroa_idx.epil = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %21, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%.sroa.0175.0 = phi double [ %.sroa.0175.0.copyload184, %L55 ], [ %arrayref88.sroa.0.0.copyload, %idxend85 ], [ 0.000000e+00, %top ], [ %100, %idxend103 ], [ %.lcssa262.ph, %L59.loopexit.unr-lcssa ], [ %23, %L59.loopexit ]: {}, intvals: {}
%.sroa.10.0 = phi double [ %.sroa.10.0.copyload194, %L55 ], [ %arrayref88.sroa.2.0.copyload, %idxend85 ], [ 0.000000e+00, %top ], [ %101, %idxend103 ], [ %.lcssa261.ph, %L59.loopexit.unr-lcssa ], [ %24, %L59.loopexit ]: {}, intvals: {}
%25 = addrspacecast {} addrspace(10)* %3 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !186: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arraylen3 = load i64, i64 addrspace(11)* %arraylen_ptr2, align 8, !dbg !186, !tbaa !140, !range !143, !alias.scope !144, !noalias !145, !enzyme_type !200, !enzyme_inactive !0, !enzymejl_source_type_UInt64 !0, !enzymejl_byref_BITS_VALUE !0: {[-1]:Integer}, intvals: {}
%.not203 = icmp eq i64 %arraylen3, 0, !dbg !210: {[-1]:Integer}, intvals: {}
%26 = call noalias nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 130282549281632 to {}*) to {} addrspace(10)*), i64 %arraylen3) #127, !dbg !201: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%.phi.trans.insert = addrspacecast {} addrspace(10)* %26 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arraylen_ptr32.phi.trans.insert = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %.phi.trans.insert, i64 0, i32 1: {[-1]:Pointer, [-1,0]:Integer, [-1,1]:Integer, [-1,2]:Integer, [-1,3]:Integer, [-1,4]:Integer, [-1,5]:Integer, [-1,6]:Integer, [-1,7]:Integer}, intvals: {}
%arraylen33.pre = load i64, i64 addrspace(11)* %arraylen_ptr32.phi.trans.insert, align 8, !dbg !110, !tbaa !140, !range !143, !alias.scope !144, !noalias !145, !enzyme_type !200, !enzyme_inactive !0, !enzymejl_source_type_UInt64 !0, !enzymejl_byref_BITS_VALUE !0: {[-1]:Integer}, intvals: {}
%32 = fsub double %30, %31, !dbg !242: {[-1]:Float@double}, intvals: {}
%27 = addrspacecast {} addrspace(10)* %3 to [1 x [2 x double]] addrspace(13)* addrspace(11)*: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arrayptr206 = load [1 x [2 x double]] addrspace(13)*, [1 x [2 x double]] addrspace(13)* addrspace(11)* %27, align 16, !tbaa !215, !alias.scope !217, !noalias !145, !nonnull !0, !enzyme_type !218, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BGeometryBasics.Point\7B2\2C\20Float64\7D\7D !0: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
i64 3: {[-1]:Integer}, intvals: {3,}
i64 2: {[-1]:Integer}, intvals: {2,}
%iv.next8 = add nuw nsw i64 %iv7, 1, !dbg !159: {[-1]:Integer}, intvals: {1,}
%14 = call {}*** @julia.get_pgcstack() #126: {[-1]:Pointer, [-1,16]:Pointer}, intvals: {}
%7 = getelementptr inbounds {}*, {}** %6, i64 16: {[-1]:Pointer}, intvals: {}
%.lcssa.ph = phi double [ undef, %idxend75.preheader ], [ %97, %L222.loopexit.unr-lcssa.loopexit ]: {[-1]:Float@double}, intvals: {}
%value_phi68234.unr = phi i64 [ 2, %idxend75.preheader ], [ %95, %L222.loopexit.unr-lcssa.loopexit ]: {[-1]:Integer}, intvals: {2,10,}
%value_phi67233.unr = phi double [ %67, %idxend75.preheader ], [ %97, %L222.loopexit.unr-lcssa.loopexit ]: {[-1]:Float@double}, intvals: {}
%lcmp.mod.not = icmp eq i64 %xtraiter, 0, !dbg !158: {[-1]:Integer}, intvals: {}
%value_phi67233.epil = phi double [ %52, %idxend75.epil ], [ %value_phi67233.unr, %idxend75.epil.preheader ]: {[-1]:Float@double}, intvals: {}
%50 = add nuw nsw i64 %49, 1, !dbg !159: {[-1]:Integer}, intvals: {3,11,}
%arrayref78.epil = load double, double addrspace(13)* %51, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%52 = fadd double %value_phi67233.epil, %arrayref78.epil, !dbg !293: {[-1]:Float@double}, intvals: {}
%epil.iter.cmp.not = icmp eq i64 %iv.next8, %xtraiter, !dbg !158: {[-1]:Integer}, intvals: {}
%value_phi35 = phi double [ %arrayref48, %idxend45 ], [ %48, %L208 ], [ 0.000000e+00, %L180 ], [ %67, %idxend63 ], [ %.lcssa.ph, %L222.loopexit.unr-lcssa ], [ %52, %L222.loopexit ]: {[-1]:Float@double}, intvals: {}
%28 = addrspacecast {} addrspace(10)* %26 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arraylen_ptr16 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %28, i64 0, i32 1: {[-1]:Pointer, [-1,0]:Integer, [-1,1]:Integer, [-1,2]:Integer, [-1,3]:Integer, [-1,4]:Integer, [-1,5]:Integer, [-1,6]:Integer, [-1,7]:Integer}, intvals: {}
%29 = addrspacecast {} addrspace(10)* %26 to double addrspace(13)* addrspace(11)*: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%70 = icmp ult i64 %69, 7, !dbg !158: {[-1]:Integer}, intvals: {}
%unroll_iter = and i64 %68, -8, !dbg !158: {[-1]:Integer}, intvals: {}
%value_phi67233 = phi double [ %67, %idxend75.preheader.new ], [ %97, %idxend75 ]: {[-1]:Float@double}, intvals: {}
%74 = or i64 %73, 1, !dbg !159: {[-1]:Integer}, intvals: {}
%33 = icmp slt i64 %bitcast_coercion, 0, !dbg !251: {[-1]:Integer}, intvals: {}
%34 = select i1 %33, double %31, double %30, !dbg !251: {[-1]:Float@double}, intvals: {}
%35 = fcmp ord double %arrayref.sroa.0.0.copyload, %arrayref.sroa.5.0.copyload, !dbg !253: {[-1]:Integer}, intvals: {}
%36 = select i1 %35, double %34, double %32, !dbg !257: {[-1]:Float@double}, intvals: {}
%37 = fsub double %36, %36, !dbg !259: {[-1]:Float@double}, intvals: {}
%38 = fcmp ord double %37, 0.000000e+00, !dbg !263: {[-1]:Integer}, intvals: {}
%48 = call fastcc double @julia_mapreduce_impl_20412({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %26, i64 noundef signext 1, i64 signext %arraylen33) #126, !dbg !151: {[-1]:Float@double}, intvals: {}
%31 = call double @llvm.fabs.f64(double %arrayref.sroa.5.0.copyload) #126, !dbg !239: {[-1]:Float@double}, intvals: {}
%value_phi113238.epil = phi double [ %23, %idxend122.epil ], [ %value_phi113238.unr, %idxend122.epil.preheader ]: {[-1]:Float@double}, intvals: {}
%iv3 = phi i64 [ %iv.next4, %idxend21 ], [ 0, %L95.lr.ph ]: {[-1]:Integer}, intvals: {0,}
%22 = add nuw nsw i64 %21, 1, !dbg !159: {[-1]:Integer}, intvals: {3,11,}
%arrayref125.sroa.0.0.copyload.epil = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.epil, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.epil = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.epil, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%bitcast_coercion = bitcast double %32 to i64, !dbg !247: {[-1]:Float@double}, intvals: {}
%23 = fadd double %value_phi113238.epil, %arrayref125.sroa.0.0.copyload.epil, !dbg !168: {[-1]:Float@double}, intvals: {}
%24 = fadd double %value_phi114239.epil, %arrayref125.sroa.2.0.copyload.epil, !dbg !168: {[-1]:Float@double}, intvals: {}
%iv.next4 = add nuw nsw i64 %iv3, 1, !dbg !304: {[-1]:Integer}, intvals: {1,}
%epil.iter265.cmp.not = icmp eq i64 %iv.next2, %xtraiter264, !dbg !158: {[-1]:Integer}, intvals: {}
i64 1: {[-1]:Integer}, intvals: {1,}
%iv.next2 = add nuw nsw i64 %iv1, 1, !dbg !159: {[-1]:Integer}, intvals: {1,}
%ptls_field199 = getelementptr inbounds {}**, {}*** %14, i64 2: {[-1]:Pointer, [-1,0]:Pointer}, intvals: {}
%72 = shl i64 %iv5, 3, !dbg !159: {[-1]:Integer}, intvals: {0,}
double 0.000000e+00: {[-1]:Anything}, intvals: {}
i64 -3: {[-1]:Integer}, intvals: {-3,}
i32 0: {[-1]:Anything}, intvals: {0,}
i64 8: {[-1]:Integer}, intvals: {8,}
%arrayref125.sroa.2.0..sroa_idx158.7 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %126, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.7 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.7, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%130 = fadd double %127, %arrayref125.sroa.0.0.copyload.7, !dbg !168: {[-1]:Float@double}, intvals: {}
%131 = fadd double %128, %arrayref125.sroa.2.0.copyload.7, !dbg !168: {[-1]:Float@double}, intvals: {}
%niter270.next.7 = add i64 %105, 8, !dbg !158: {[-1]:Integer}, intvals: {8,}
%niter270.ncmp.7 = icmp eq i64 %niter270.next.7, %unroll_iter269, !dbg !158: {[-1]:Integer}, intvals: {}
%6 = getelementptr inbounds {}*, {}** %5, i64 -14: {[-1]:Pointer}, intvals: {}
[1 x [2 x double]]* %0: {[-1]:Pointer}, intvals: {}
[1 x {} addrspace(10)*] addrspace(11)* %1: {[-1]:Pointer, [-1,-1]:Pointer, [-1,0,0]:Pointer, [-1,0,0,-1]:Float@double, [-1,0,8]:Integer, [-1,0,9]:Integer, [-1,0,10]:Integer, [-1,0,11]:Integer, [-1,0,12]:Integer, [-1,0,13]:Integer, [-1,0,14]:Integer, [-1,0,15]:Integer, [-1,0,16]:Integer, [-1,0,17]:Integer, [-1,0,18]:Integer, [-1,0,19]:Integer, [-1,0,20]:Integer, [-1,0,21]:Integer, [-1,0,22]:Integer, [-1,0,23]:Integer, [-1,0,24]:Integer, [-1,0,25]:Integer, [-1,0,26]:Integer, [-1,0,27]:Integer, [-1,0,28]:Integer, [-1,0,29]:Integer, [-1,0,30]:Integer, [-1,0,31]:Integer, [-1,0,32]:Integer, [-1,0,33]:Integer, [-1,0,34]:Integer, [-1,0,35]:Integer, [-1,0,36]:Integer, [-1,0,37]:Integer, [-1,0,38]:Integer, [-1,0,39]:Integer}, intvals: {}
{} addrspace(10)* %2: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Integer, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
{} addrspace(10)* %3: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arrayref106.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref106.sroa.2.0..sroa_idx169, align 1, !dbg !334, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%100 = fadd double %arrayref97.sroa.0.0.copyload, %arrayref106.sroa.0.0.copyload, !dbg !340: {[-1]:Float@double}, intvals: {}
%101 = fadd double %arrayref97.sroa.2.0.copyload, %arrayref106.sroa.2.0.copyload, !dbg !340: {[-1]:Float@double}, intvals: {}
%.not217237 = icmp ugt i64 %arraylen, 2, !dbg !339: {[-1]:Integer}, intvals: {}
%102 = add nsw i64 %arraylen, -2, !dbg !158: {[-1]:Integer}, intvals: {}
%103 = add nsw i64 %arraylen, -3, !dbg !158: {[-1]:Integer}, intvals: {}
%xtraiter264 = and i64 %102, 7, !dbg !158: {[-1]:Integer}, intvals: {}
%104 = icmp ult i64 %103, 7, !dbg !158: {[-1]:Integer}, intvals: {}
%unroll_iter269 = and i64 %102, -8, !dbg !158: {[-1]:Integer}, intvals: {}
%value_phi114239 = phi double [ %101, %idxend122.preheader.new ], [ %131, %idxend122 ]: {[-1]:Float@double}, intvals: {}
%value_phi113238 = phi double [ %100, %idxend122.preheader.new ], [ %130, %idxend122 ]: {[-1]:Float@double}, intvals: {}
%iv7 = phi i64 [ 0, %idxend75.epil.preheader ], [ %iv.next8, %idxend75.epil ]: {[-1]:Integer}, intvals: {0,}
%108 = or i64 %107, 1, !dbg !159: {[-1]:Integer}, intvals: {}
%arrayref125.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %107, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%13 = bitcast i8* %12 to [1 x [2 x double]]*, !enzyme_caststack !0: {[-1]:Pointer}, intvals: {}
i64 15: {[-1]:Integer}, intvals: {15,}
%21 = add nuw nsw i64 %value_phi115240.unr, %iv1, !dbg !159: {[-1]:Integer}, intvals: {2,10,}
%17 = addrspacecast { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(10)* %11 to { [1 x {} addrspace(10)*], [1 x [2 x {} addrspace(10)*]] } addrspace(11)*, !dbg !91: {[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double, [-1,8,0,-1]:Integer, [-1,16,0,-1]:Float@double}, intvals: {}
%39 = fcmp une double %36, 0.000000e+00, !dbg !267: {[-1]:Integer}, intvals: {}
%19 = addrspacecast {} addrspace(10)* %18 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !110: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arraylen = load i64, i64 addrspace(11)* %arraylen_ptr, align 8, !dbg !110, !tbaa !140, !range !143, !alias.scope !144, !noalias !145: {[-1]:Integer}, intvals: {}
%20 = icmp ugt i64 %arraylen, 15, !dbg !147: {[-1]:Integer}, intvals: {}
%value_phi114239.epil = phi double [ %24, %idxend122.epil ], [ %value_phi114239.unr, %idxend122.epil.preheader ]: {[-1]:Float@double}, intvals: {}
call fastcc void @julia_mapreduce_impl_20409([1 x [2 x double]]* noalias nocapture nofree noundef nonnull writeonly sret([1 x [2 x double]]) align 8 dereferenceable(16) %13, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %18, i64 noundef signext 1, i64 signext %arraylen) #126, !dbg !151: {}, intvals: {}
%.sroa.0175.0.copyload184 = load double, double* %.sroa.0175.0..sroa_idx183, align 8, !dbg !91, !tbaa !154, !alias.scope !156, !noalias !157: {}, intvals: {}
%.sroa.10.0.copyload194 = load double, double* %.sroa.10.0..sroa_idx193, align 8, !dbg !91, !tbaa !154, !alias.scope !156, !noalias !157: {}, intvals: {}
%.lcssa262.ph = phi double [ undef, %idxend122.preheader ], [ %130, %L59.loopexit.unr-lcssa.loopexit ]: {[-1]:Float@double}, intvals: {}
%.lcssa261.ph = phi double [ undef, %idxend122.preheader ], [ %131, %L59.loopexit.unr-lcssa.loopexit ]: {[-1]:Float@double}, intvals: {}
%value_phi115240.unr = phi i64 [ 2, %idxend122.preheader ], [ %129, %L59.loopexit.unr-lcssa.loopexit ]: {[-1]:Integer}, intvals: {2,10,}
%value_phi114239.unr = phi double [ %101, %idxend122.preheader ], [ %131, %L59.loopexit.unr-lcssa.loopexit ]: {[-1]:Float@double}, intvals: {}
%value_phi113238.unr = phi double [ %100, %idxend122.preheader ], [ %130, %L59.loopexit.unr-lcssa.loopexit ]: {[-1]:Float@double}, intvals: {}
%lcmp.mod266.not = icmp eq i64 %xtraiter264, 0, !dbg !158: {[-1]:Integer}, intvals: {}
%getfield_addr = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(11)* %1, i64 0, i64 0, !dbg !91: {[-1]:Pointer, [-1,-1]:Pointer, [-1,0,0]:Pointer, [-1,0,0,-1]:Float@double, [-1,0,8]:Integer, [-1,0,9]:Integer, [-1,0,10]:Integer, [-1,0,11]:Integer, [-1,0,12]:Integer, [-1,0,13]:Integer, [-1,0,14]:Integer, [-1,0,15]:Integer, [-1,0,16]:Integer, [-1,0,17]:Integer, [-1,0,18]:Integer, [-1,0,19]:Integer, [-1,0,20]:Integer, [-1,0,21]:Integer, [-1,0,22]:Integer, [-1,0,23]:Integer, [-1,0,24]:Integer, [-1,0,25]:Integer, [-1,0,26]:Integer, [-1,0,27]:Integer, [-1,0,28]:Integer, [-1,0,29]:Integer, [-1,0,30]:Integer, [-1,0,31]:Integer, [-1,0,32]:Integer, [-1,0,33]:Integer, [-1,0,34]:Integer, [-1,0,35]:Integer, [-1,0,36]:Integer, [-1,0,37]:Integer, [-1,0,38]:Integer, [-1,0,39]:Integer}, intvals: {}
double undef: {[-1]:Anything}, intvals: {}
%86 = add nuw nsw i64 %73, 5, !dbg !159: {[-1]:Integer}, intvals: {7,}
%87 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %83, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.4 = load double, double addrspace(13)* %87, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%88 = fadd double %85, %arrayref78.4, !dbg !293: {[-1]:Float@double}, intvals: {}
%89 = add nuw nsw i64 %73, 6, !dbg !159: {[-1]:Integer}, intvals: {8,}
%90 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %86, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.5 = load double, double addrspace(13)* %90, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%91 = fadd double %88, %arrayref78.5, !dbg !293: {[-1]:Float@double}, intvals: {}
%92 = add nuw nsw i64 %73, 7, !dbg !159: {[-1]:Integer}, intvals: {9,}
%93 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %89, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.6 = load double, double addrspace(13)* %93, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%94 = fadd double %91, %arrayref78.6, !dbg !293: {[-1]:Float@double}, intvals: {}
%95 = add nuw nsw i64 %73, 8, !dbg !159: {[-1]:Integer}, intvals: {10,}
%96 = getelementptr inbounds double, double addrspace(13)* %arrayptr56211, i64 %92, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref78.7 = load double, double addrspace(13)* %96, align 8, !dbg !162, !tbaa !288, !alias.scope !291, !noalias !292: {[-1]:Float@double}, intvals: {}
%97 = fadd double %94, %arrayref78.7, !dbg !293: {[-1]:Float@double}, intvals: {}
%niter.next.7 = add i64 %71, 8, !dbg !158: {[-1]:Integer}, intvals: {8,}
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter, !dbg !158: {[-1]:Integer}, intvals: {}
%98 = addrspacecast {} addrspace(10)* %18 to i8 addrspace(13)* addrspace(11)*, !dbg !328: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}, intvals: {}
%arrayptr87214215 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(11)* %98, align 8, !dbg !328, !tbaa !215, !alias.scope !217, !noalias !145, !nonnull !0: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%iv.next = add nuw nsw i64 %iv, 1, !dbg !159: {[-1]:Integer}, intvals: {1,}
%106 = shl i64 %iv, 3, !dbg !159: {[-1]:Integer}, intvals: {0,}
%105 = shl nuw i64 %iv, 3, !dbg !159: {[-1]:Integer}, intvals: {0,}
%arrayref125.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %107, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%109 = fadd double %value_phi113238, %arrayref125.sroa.0.0.copyload, !dbg !168: {[-1]:Float@double}, intvals: {}
%110 = fadd double %value_phi114239, %arrayref125.sroa.2.0.copyload, !dbg !168: {[-1]:Float@double}, intvals: {}
%111 = add nuw nsw i64 %107, 2, !dbg !159: {[-1]:Integer}, intvals: {4,}
%arrayref125.sroa.0.0..sroa_idx.1 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %108, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.1 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.1, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.1 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %108, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0.copyload.1 = load double, double addrspace(13)* %arrayref125.sroa.2.0..sroa_idx158.1, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%112 = fadd double %109, %arrayref125.sroa.0.0.copyload.1, !dbg !168: {[-1]:Float@double}, intvals: {}
%113 = fadd double %110, %arrayref125.sroa.2.0.copyload.1, !dbg !168: {[-1]:Float@double}, intvals: {}
%114 = add nuw nsw i64 %107, 3, !dbg !159: {[-1]:Integer}, intvals: {5,}
%arrayref125.sroa.0.0..sroa_idx.2 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %111, i64 0, i64 0, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref125.sroa.0.0.copyload.2 = load double, double addrspace(13)* %arrayref125.sroa.0.0..sroa_idx.2, align 1, !dbg !162, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref125.sroa.2.0..sroa_idx158.2 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr96216, i64 %111, i64 0, i64 1, !dbg !162: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
{} addrspace(10)* addrspacecast ({}* inttoptr (i64 130277802531216 to {}*) to {} addrspace(10)*): {[-1]:Anything}, intvals: {}
%5 = bitcast {}*** %4 to {}**: {[-1]:Pointer}, intvals: {}
%8 = bitcast {}** %7 to i8**: {[-1]:Pointer}, intvals: {}
%9 = load i8*, i8** %8, align 8: {}, intvals: {}
%10 = call noalias nonnull dereferenceable(24) dereferenceable_or_null(24) {} addrspace(10)* @jl_gc_alloc_typed(i8* %9, i64 24, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 130277802531216 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !84: {[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double, [-1,8,0,-1]:Integer, [-1,16,0,-1]:Float@double}, intvals: {}
i64 6: {[-1]:Integer}, intvals: {6,}
%73 = add nuw nsw i64 %72, 2, !dbg !159: {[-1]:Integer}, intvals: {2,}
{} addrspace(10)* addrspacecast ({}* inttoptr (i64 130282549281632 to {}*) to {} addrspace(10)*): {[-1]:Anything}, intvals: {}
%53 = fdiv double %.sroa.0175.0, %value_phi35, !dbg !296: {[-1]:Float@double}, intvals: {}
%54 = fdiv double %.sroa.10.0, %value_phi35, !dbg !296: {[-1]:Float@double}, intvals: {}
%newstruct39.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %0, i64 0, i64 0, i64 0, !dbg !299: {[-1]:Pointer, [-1,0]:Float@double}, intvals: {}
%newstruct39.sroa.2.0..sroa_idx171 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]]* %0, i64 0, i64 0, i64 1, !dbg !299: {[-1]:Pointer, [-1,0]:Float@double}, intvals: {}
%iv5 = phi i64 [ %iv.next6, %idxend75 ], [ 0, %idxend75.preheader.new ]: {[-1]:Integer}, intvals: {0,}
%iv.next6 = add nuw nsw i64 %iv5, 1, !dbg !159: {[-1]:Integer}, intvals: {1,}
%arrayref.sroa.0.0..sroa_idx = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr206, i64 %iv3, i64 0, i64 0, !dbg !308: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref.sroa.0.0.copyload = load double, double addrspace(13)* %arrayref.sroa.0.0..sroa_idx, align 1, !dbg !308, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%arrayref.sroa.5.0..sroa_idx172 = getelementptr inbounds [1 x [2 x double]], [1 x [2 x double]] addrspace(13)* %arrayptr206, i64 %iv3, i64 0, i64 1, !dbg !308: {[-1]:Pointer, [-1,-1]:Float@double}, intvals: {}
%arrayref.sroa.5.0.copyload = load double, double addrspace(13)* %arrayref.sroa.5.0..sroa_idx172, align 1, !dbg !308, !tbaa !165, !alias.scope !166, !noalias !167: {[-1]:Float@double}, intvals: {}
%55 = fmul double %arrayref.sroa.0.0.copyload, %arrayref.sroa.0.0.copyload, !dbg !317: {[-1]:Float@double}, intvals: {}
%56 = fmul double %arrayref.sroa.5.0.copyload, %arrayref.sroa.5.0.copyload, !dbg !317: {[-1]:Float@double}, intvals: {}
%57 = fadd double %55, %56, !dbg !321: {[-1]:Float@double}, intvals: {}
%58 = call double @julia_sqrt_20345(double %57) #128, !dbg !320: {[-1]:Float@double}, intvals: {}
%59 = fcmp ule double %58, 0.000000e+00, !dbg !322: {[-1]:Integer}, intvals: {}
%60 = fsub double %58, %58: {[-1]:Float@double}, intvals: {}
%61 = fcmp uno double %60, 0.000000e+00: {[-1]:Integer}, intvals: {}
</analysis>
Cannot deduce type of phi %.sroa.0175.0 = phi double [ %.sroa.0175.0.copyload184, %L55 ], [ %arrayref88.sroa.0.0.copyload, %idxend85 ], [ 0.000000e+00, %top ], [ %100, %idxend103 ], [ %.lcssa262.ph, %L59.loopexit.unr-lcssa ], [ %23, %L59.loopexit ]{} sz: 8
Caused by:
Stacktrace:
[1] size
@ ./array.jl:191
[2] axes
@ ./abstractarray.jl:98
[3] combine_axes
@ ./broadcast.jl:525
[4] _axes
@ ./broadcast.jl:236
[5] axes
@ ./broadcast.jl:234
[6] similar
@ ./broadcast.jl:223
[7] override_bc_materialize
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler/interpreter.jl:701
[8] #19
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:88
within MethodInstance for (::var"#19#28"{Vector{Float64}})(::Vector{Int64}, ::Vector{GeometryBasics.Point{2, Float64}})
Stacktrace:
[1] #19
@ ./essentials.jl:0
[2] #4
@ ./generator.jl:36 [inlined]
[3] iterate
@ ./generator.jl:47 [inlined]
[4] collect_to!
@ ./array.jl:892 [inlined]
[5] collect_to_with_first!
@ ./array.jl:870 [inlined]
[6] collect
@ ./array.jl:844
[7] map
@ ./abstractarray.jl:3409 [inlined]
[8] #14
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:87 [inlined]
[9] #22
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:94 [inlined]
[10] f
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/ice_sheet1D_alloc.jl:56
[11] ODEFunction
@ ~/.julia/packages/SciMLBase/NtgCQ/src/scimlfunctions.jl:2358 [inlined]
[12] ODEFunction
@ ~/.julia/packages/SciMLBase/NtgCQ/src/scimlfunctions.jl:0 [inlined]
[13] diffejulia_ODEFunction_20316_inner_1wrap
@ ~/.julia/packages/SciMLBase/NtgCQ/src/scimlfunctions.jl:0
[14] macro expansion
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:8398 [inlined]
[15] enzyme_call
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7950 [inlined]
[16] AdjointThunk
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7755 [inlined]
[17] runtime_generic_rev(activity::Type{…}, runtimeActivity::Val{…}, width::Val{…}, ModifiedBetween::Val{…}, tape::Enzyme.Compiler.Tape{…}, f::ODEFunction{…}, df::ODEFunction{…}, primal_1::ComponentVector{…}, shadow_1_1::ComponentVector{…}, primal_2::ComponentVector{…}, shadow_2_1::ComponentVector{…}, primal_3::ComponentVector{…}, shadow_3_1::ComponentVector{…}, primal_4::Float64, shadow_4_1::Base.RefValue{…})
@ Enzyme.Compiler ~/Documents/Work/dev/Enzyme.jl/src/rules/jitrules.jl:696
[18] steploss
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:127 [inlined]
[19] steploss
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:0 [inlined]
[20] diffejulia_steploss_15525_inner_1wrap
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:0
[21] macro expansion
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:8398 [inlined]
[22] enzyme_call
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7950 [inlined]
[23] CombinedAdjointThunk
@ ~/Documents/Work/dev/Enzyme.jl/src/compiler.jl:7723 [inlined]
[24] autodiff
@ ~/Documents/Work/dev/Enzyme.jl/src/Enzyme.jl:491 [inlined]
[25] autodiff
@ ~/Documents/Work/dev/Enzyme.jl/src/Enzyme.jl:537 [inlined]
[26] autodiff(::ReverseMode{…}, ::typeof(steploss), ::Duplicated{…}, ::Duplicated{…})
@ Enzyme ~/Documents/Work/dev/Enzyme.jl/src/Enzyme.jl:504
[27] top-level scope
@ ~/Documents/Work/dev/DecapodeCalibrationNewEnzyme/DecapodeEnzymeGrad.jl:137
Some type information was truncated. Use `show(err)` to see complete types.
|
@ChrisRackauckas this ^ was the latest error |
If you do
FBDF()
the forwarddiff fails. The forwarddiff also fails if the sensealg usesautodiff = true
.The text was updated successfully, but these errors were encountered: