Enzyme.jl
Enzyme.jl copied to clipboard
TypeInference failure with ValueShapes.jl
This crashes Enzyme:
using Enzyme, ValueShapes
function diffeq_step!(du, u, p, t)
vs_u = NamedTupleShape(ShapedAsNT,
x = ArrayShape{Real}(2,3),
y = ArrayShape{Real}(2,3),
z = ScalarShape{Real}(),
)
vs_p = NamedTupleShape(ShapedAsNT,
a = ArrayShape{Real}(4),
b = ScalarShape{Real}(),
)
shaped_u = vs_u(u)
shaped_du = vs_u(u)
# Causes the Enzyme crash:
shaped_du.x[:] = shaped_u.x
# ...
nothing
end
du = rand(13)
u = rand(13)
p = rand(5)
t = 1.0
diffeq_step!(du, u, p, t)
ddu = Duplicated(du, fill!(similar(du), 1))
dp = Duplicated(p, zero(p))
Enzyme.autodiff(diffeq_step!, ddu, u, dp, t)
with
; ModuleID = 'text'
source_filename = "text"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: readnone
declare {}*** @julia.get_pgcstack() local_unnamed_addr #0
declare nonnull {} addrspace(10)* @jl_invoke({} addrspace(10)*, {} addrspace(10)** nocapture readonly, i32, {} addrspace(10)*) local_unnamed_addr
; Function Attrs: inaccessiblememonly allocsize(1)
declare noalias nonnull {} addrspace(10)* @julia.gc_alloc_obj(i8*, i64, {} addrspace(10)*) local_unnamed_addr #1
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.memcpy.p10i8.p11i8.i64(i8 addrspace(10)* noalias nocapture writeonly, i8 addrspace(11)* noalias nocapture readonly, i64, i1 immarg) #2
...
shaped_u.x
and shaped_du.x
just produce reshaped array views, so there shouldn't be any AD-unfriendly stuff in the code (well, in principle ... :-) ).
System info:
julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
pkg> st Enzyme ValueShapes
Status `/user/.julia/environments/bat-dev/Project.toml`
[7da242da] Enzyme v0.9.5
[136a8f8c] ValueShapes v0.10.3 `/user/.julia/dev/ValueShapes`
Can you post the full trace to Gist or something similar?
And give current main a try
Looks the same with main, here's the gist: https://gist.github.com/oschulz/94c37f22e1c7afe766f223737196d513
could not deduce type of integer %value_phi14152 = phi double [ %49, %L174.lr.ph ], [ %value_phi20, %L148 ]
julia: /workspace/srcdir/Enzyme/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp:4877: ConcreteType TypeResults::intType(size_t, llvm::Value*, bool, bool): Assertion `0 && "could not deduce type of integer"' failed.
val: %49 = load double, double addrspace(13)* %48, align 8, !dbg !143, !tbaa !151 - {}
val: %value_phi20 = phi double [ %74, %L230 ], [ undef, %L174 ] - {}
val: %74 = load double, double addrspace(13)* %73, align 8, !dbg !188, !tbaa !151 - {}
val: %48 = getelementptr inbounds double, double addrspace(13)* %47, i64 %.pn138, !dbg !143 - {[-1]:Pointer}
val: %73 = getelementptr inbounds double, double addrspace(13)* %72, i64 %71, !dbg !188 - {[-1]:Pointer}
val: %72 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %59, align 8, !dbg !188, !tbaa !52, !nonnull !4 - {[-1]:Pointer}
val: %59 = addrspacecast double addrspace(13)* addrspace(10)* %58 to double addrspace(13)* addrspace(11)* - {[-1]:Pointer, [-1,0]:Pointer, [-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, [-1,40]:Integer}
This now gives a julia-level error, but is the same error needing fixing.
@vchuravy interestingly this now segfaults.
wmoses@beast:~/git/Enzyme.jl ((HEAD detached at origin/main)) $ cat vs.jl
using Enzyme, ValueShapes
Enzyme.API.printall!(true)
function diffeq_step!(u)
vs_u = NamedTupleShape(ShapedAsNT,
x = ArrayShape{Real}(2),
)
shaped_u = ShapedAsNT(u, vs_u)
# Causes the Enzyme crash:
shaped_u.x[:] = shaped_u.x
# shaped_u.x[:] = shaped_u.x
# ...
nothing
end
u = rand(2)
diffeq_step!(u)
@show "primal"
Enzyme.autodiff(diffeq_step!, u)
@show "grad"
Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007f9a3603cbf8 in julia_copyto_unaliased!_2092 (deststyle=..., dest=<optimized out>, srcstyle=..., src=...) at abstractarray.jl:1028
1028 abstractarray.jl: No such file or directory.
(rr) bt
#0 0x00007f9a3603cbf8 in julia_copyto_unaliased!_2092 (deststyle=..., dest=<optimized out>, srcstyle=...,
src=...) at abstractarray.jl:1028
#1 0x00007f9a3603cb53 in julia_copyto!_2088 (dest=<optimized out>, src=...) at abstractarray.jl:1018
#2 0x00007f9a3603bf80 in unaliascopy () at subarray.jl:111
#3 unalias () at abstractarray.jl:1427
#4 julia__unsafe_setindex!_2076 (A=..., x=..., I...=...) at multidimensional.jl:936
#5 0x00007f9a3603d020 in _setindex! () at multidimensional.jl:930
#6 setindex! () at abstractarray.jl:1344
#7 julia_diffeq_step!_2069 (u=<optimized out>) at /home/wmoses/git/Enzyme.jl/vs.jl:12
#8 0x00007f9a3603d020 in julia_diffeq_step!_2069 (u=<optimized out>)
#9 0x00007f9a1adb41c0 in macro expansion () at /home/wmoses/git/Enzyme.jl/src/compiler.jl:6118
#10 enzyme_call () at /home/wmoses/git/Enzyme.jl/src/compiler.jl:5849
#11 CombinedAdjointThunk () at /home/wmoses/git/Enzyme.jl/src/compiler.jl:5826
#12 autodiff () at /home/wmoses/git/Enzyme.jl/src/Enzyme.jl:317
#13 autodiff () at /home/wmoses/git/Enzyme.jl/src/Enzyme.jl:348
#14 julia_autodiff_3906 (f=..., args...=...) at /home/wmoses/git/Enzyme.jl/src/Enzyme.jl:454
#15 0x00007f9a1adb41e4 in jfptr_autodiff_3907 ()
#16 0x00007f9a36088b2e in _jl_invoke (world=<optimized out>, mfunc=0x7f9a2dd6b0d0, nargs=2, args=0x7ffdfd719e08,
F=0x7f9a2c0df420) at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2367
#17 ijl_apply_generic (F=<optimized out>, args=args@entry=0x7ffdfd719e08, nargs=nargs@entry=2)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2549
#18 0x00007f9a360a5c15 in jl_apply (nargs=3, args=0x7ffdfd719e00)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/julia.h:1838
#19 do_call (args=args@entry=0x7f9a2dd6afb8, nargs=nargs@entry=3, s=s@entry=0x7ffdfd71a070)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/interpreter.c:126
#20 0x00007f9a360a5658 in eval_value (e=e@entry=0x7f9a2ec2b470, s=s@entry=0x7ffdfd71a070)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/interpreter.c:215
#21 0x00007f9a360a6106 in eval_stmt_value (s=0x7ffdfd71a070, stmt=<optimized out>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/interpreter.c:166
#22 eval_body (stmts=<optimized out>, s=s@entry=0x7ffdfd71a070, ip=1, ip@entry=0, toplevel=toplevel@entry=1)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/interpreter.c:612
#23 0x00007f9a360a6fa2 in jl_interpret_toplevel_thunk (m=m@entry=0x7f9a21128ef0 <jl_system_image_data+2391088>,
src=0x7f9a05442690) at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/interpreter.c:750
#24 0x00007f9a360c6381 in jl_toplevel_eval_flex (m=m@entry=0x7f9a21128ef0 <jl_system_image_data+2391088>,
e=<optimized out>, fast=fast@entry=1, expanded=expanded@entry=0)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/toplevel.c:906
#25 0x00007f9a360c6f51 in jl_toplevel_eval_flex (m=m@entry=0x7f9a21128ef0 <jl_system_image_data+2391088>,
e=e@entry=0x7f9a2b566090, fast=fast@entry=1, expanded=expanded@entry=0)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/toplevel.c:850
#26 0x00007f9a360c80bc in ijl_toplevel_eval (m=m@entry=0x7f9a21128ef0 <jl_system_image_data+2391088>,
v=v@entry=0x7f9a2b566090) at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/toplevel.c:915
#27 0x00007f9a360c81db in ijl_toplevel_eval_in (m=0x7f9a21128ef0 <jl_system_image_data+2391088>,
ex=0x7f9a2b566090) at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/toplevel.c:965
#28 0x00007f9a20800d42 in eval () at boot.jl:368
#29 japi1_include_string_59253 () at loading.jl:1428
#30 0x00007f9a36088b2e in _jl_invoke (world=<optimized out>,
mfunc=0x7f9a21ba22d0 <jl_system_image_data+13373456>, nargs=4, args=0x7ffdfd71a748,
F=0x7f9a21ba1f90 <jl_system_image_data+13372624>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2367
#31 ijl_apply_generic (F=<optimized out>, args=0x7ffdfd71a748, nargs=<optimized out>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2549
#32 0x00007f9a20839352 in japi1__include_61496 () at loading.jl:1488
#33 0x00007f9a200b71b1 in julia_include_32220 () at Base.jl:419
#34 0x00007f9a200b71d0 in jfptr_include_32221.clone_1 ()
from /home/wmoses/git/Enzyme.jl/julia-1.8.1/lib/julia/sys.so
#35 0x00007f9a36088b2e in _jl_invoke (world=<optimized out>, mfunc=0x7f9a214c54d0 <jl_system_image_data+6177296>,
nargs=2, args=0x7ffdfd71ad78, F=0x7f9a214c5190 <jl_system_image_data+6176464>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2367
#36 ijl_apply_generic (F=<optimized out>, args=0x7ffdfd71ad78, nargs=<optimized out>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2549
#37 0x00007f9a20a60cec in julia_exec_options_43645 () at client.jl:303
#38 0x00007f9a20531218 in julia__start_61719 () at client.jl:522
#39 0x00007f9a20531349 in jfptr.start_61720.clone_1 ()
from /home/wmoses/git/Enzyme.jl/julia-1.8.1/lib/julia/sys.so
#40 0x00007f9a36088b2e in _jl_invoke (world=<optimized out>, mfunc=0x7f9a210c37f0 <jl_system_image_data+1975600>,
nargs=0, args=0x7ffdfd71c180, F=0x7f9a210c39b0 <jl_system_image_data+1976048>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2367
#41 ijl_apply_generic (F=<optimized out>, args=args@entry=0x7ffdfd71c180, nargs=nargs@entry=0)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/gf.c:2549
#42 0x00007f9a360ee417 in jl_apply (nargs=1, args=0x7ffdfd71c178)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/julia.h:1838
#43 true_main (argc=<optimized out>, argv=<optimized out>)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/jlapi.c:575
#44 0x00007f9a360eee5f in jl_repl_entrypoint (argc=<optimized out>, argv=0x7ffdfd71c548)
at /cache/build/default-amdci5-0/julialang/julia-release-1-dot-8/src/jlapi.c:719
#45 0x0000000000401069 in main (argc=<optimized out>, argv=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(rr) disassemble
Dump of assembler code for function julia_copyto_unaliased!_2092:
0x00007f9a3603cbd0 <+0>: push %rbx
0x00007f9a3603cbd1 <+1>: mov 0x8(%rdx),%r9
0x00007f9a3603cbd5 <+5>: mov 0x10(%rdx),%rdi
0x00007f9a3603cbd9 <+9>: mov %rdi,%rax
0x00007f9a3603cbdc <+12>: sub %r9,%rax
0x00007f9a3603cbdf <+15>: movabs $0x7fffffffffffffff,%rbx
0x00007f9a3603cbe9 <+25>: cmp %rbx,%rax
0x00007f9a3603cbec <+28>: jae 0x7f9a3603cca0 <julia_copyto_unaliased!_2092+208>
0x00007f9a3603cbf2 <+34>: mov (%rsi),%rsi
0x00007f9a3603cbf5 <+37>: mov (%rcx),%rcx
=> 0x00007f9a3603cbf8 <+40>: mov (%rcx),%r10
0x00007f9a3603cbfb <+43>: mov 0x18(%rdx),%r8
0x00007f9a3603cbff <+47>: mov %rdi,%rcx
0x00007f9a3603cc02 <+50>: sub %r9,%rcx
0x00007f9a3603cc05 <+53>: lea 0x1(%rcx),%r11
0x00007f9a3603cc09 <+57>: cmp $0x2,%r11
0x00007f9a3603cc0d <+61>: jb 0x7f9a3603cc76 <julia_copyto_unaliased!_2092+166>
0x00007f9a3603cc0f <+63>: add %r8,%rdi
0x00007f9a3603cc12 <+66>: sub %r9,%rdi
0x00007f9a3603cc15 <+69>: lea 0x8(%r10,%rdi,8),%rdx
0x00007f9a3603cc1a <+74>: cmp %rdx,%rsi
0x00007f9a3603cc1d <+77>: jae 0x7f9a3603cc2c <julia_copyto_unaliased!_2092+92>
0x00007f9a3603cc1f <+79>: lea (%rsi,%r11,8),%rdx
0x00007f9a3603cc23 <+83>: lea (%r10,%r8,8),%rbx
0x00007f9a3603cc27 <+87>: cmp %rdx,%rbx
0x00007f9a3603cc2a <+90>: jb 0x7f9a3603cc76 <julia_copyto_unaliased!_2092+166>
0x00007f9a3603cc2c <+92>: mov %r11,%r9
0x00007f9a3603cc2f <+95>: and $0xfffffffffffffffe,%r9
0x00007f9a3603cc33 <+99>: sub %r9,%rax
0x00007f9a3603cc36 <+102>: mov %r9,%rdx
0x00007f9a3603cc39 <+105>: neg %rdx
0x00007f9a3603cc3c <+108>: lea -0x8(%r10,%rdi,8),%rdi
0x00007f9a3603cc41 <+113>: lea -0x8(%rsi,%rcx,8),%rcx
0x00007f9a3603cc46 <+118>: xor %ebx,%ebx
0x00007f9a3603cc48 <+120>: xorpd %xmm0,%xmm0
0x00007f9a3603cc4c <+124>: nopl 0x0(%rax)
0x00007f9a3603cc50 <+128>: movupd (%rcx,%rbx,8),%xmm1
0x00007f9a3603cc55 <+133>: movupd %xmm0,(%rcx,%rbx,8)
0x00007f9a3603cc5a <+138>: movupd (%rdi,%rbx,8),%xmm2
0x00007f9a3603cc5f <+143>: addpd %xmm1,%xmm2
0x00007f9a3603cc63 <+147>: movupd %xmm2,(%rdi,%rbx,8)
0x00007f9a3603cc68 <+152>: add $0xfffffffffffffffe,%rbx
0x00007f9a3603cc6c <+156>: cmp %rbx,%rdx
0x00007f9a3603cc6f <+159>: jne 0x7f9a3603cc50 <julia_copyto_unaliased!_2092+128>
0x00007f9a3603cc71 <+161>: cmp %r9,%r11
0x00007f9a3603cc74 <+164>: je 0x7f9a3603cca0 <julia_copyto_unaliased!_2092+208>
0x00007f9a3603cc76 <+166>: inc %rax
0x00007f9a3603cc79 <+169>: lea (%r10,%r8,8),%rcx
0x00007f9a3603cc7d <+173>: nopl (%rax)
0x00007f9a3603cc80 <+176>: movsd -0x8(%rsi,%rax,8),%xmm0
0x00007f9a3603cc86 <+182>: movq $0x0,-0x8(%rsi,%rax,8)
0x00007f9a3603cc8f <+191>: addsd -0x8(%rcx,%rax,8),%xmm0
0x00007f9a3603cc95 <+197>: movsd %xmm0,-0x8(%rcx,%rax,8)
0x00007f9a3603cc9b <+203>: dec %rax
0x00007f9a3603cc9e <+206>: jne 0x7f9a3603cc80 <julia_copyto_unaliased!_2092+176>
0x00007f9a3603cca0 <+208>: pop %rbx
0x00007f9a3603cca1 <+209>: ret
End of assembler dump.
"primal" = "primal"
after simplification :
; Function Attrs: mustprogress willreturn
define void @preprocess_julia_diffeq_step__2069_inner.1({} addrspace(10)* nonnull align 16 dereferenceable(40) %0) local_unnamed_addr #19 !dbg !580 {
entry:
%1 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%2 = alloca [1 x {} addrspace(10)*], align 8
%3 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%4 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%5 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %1 to i8*
call void @llvm.lifetime.start.p0i8(i64 noundef 40, i8* noundef nonnull align 8 dereferenceable(40) %5) #20
%6 = bitcast [1 x {} addrspace(10)*]* %2 to i8*
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull align 8 dereferenceable(8) %6) #20
%7 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3 to i8*
call void @llvm.lifetime.start.p0i8(i64 noundef 40, i8* noundef nonnull align 8 dereferenceable(40) %7) #20
%8 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4 to i8*
call void @llvm.lifetime.start.p0i8(i64 noundef 40, i8* noundef nonnull align 8 dereferenceable(40) %8) #20
%9 = call {}*** @julia.get_pgcstack() #20
call void @llvm.dbg.value(metadata {} addrspace(10)* null, metadata !583, metadata !DIExpression(DW_OP_deref)) #20, !dbg !584
call void @llvm.dbg.value(metadata {} addrspace(10)* %0, metadata !583, metadata !DIExpression(DW_OP_deref)) #20, !dbg !584
%10 = bitcast {} addrspace(10)* %0 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !586
%11 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %10 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !586
%12 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %11, i64 0, i32 1, !dbg !586
%13 = load i64, i64 addrspace(11)* %12, align 8, !dbg !586, !tbaa !162, !range !164
%.not = icmp eq i64 %13, 2, !dbg !594
br i1 %.not, label %julia_diffeq_step__2069_inner.exit, label %L9.i, !dbg !597
L9.i: ; preds = %entry
%14 = call nonnull {} addrspace(10)* @ijl_box_int64(i64 signext %13) #20, !dbg !598
%15 = call cc38 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* @ijl_invoke to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299984892240 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299955828640 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299476018736 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %14, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299476174216 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140300194545824 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299476018776 to {}*) to {} addrspace(10)*)) #21, !dbg !598
%current_task1.i22 = getelementptr inbounds {}**, {}*** %9, i64 -12, !dbg !598
%current_task1.i = bitcast {}*** %current_task1.i22 to {}**, !dbg !598
%16 = call noalias nonnull {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1.i, i64 noundef 8, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299956829248 to {}*) to {} addrspace(10)*)) #22, !dbg !598
%17 = bitcast {} addrspace(10)* %16 to {} addrspace(10)* addrspace(10)*, !dbg !598
store {} addrspace(10)* %15, {} addrspace(10)* addrspace(10)* %17, align 8, !dbg !598, !tbaa !102
%18 = addrspacecast {} addrspace(10)* %16 to {} addrspace(12)*, !dbg !598
call void @ijl_throw({} addrspace(12)* %18) #23, !dbg !598
unreachable, !dbg !598
julia_diffeq_step__2069_inner.exit: ; preds = %entry
%.fca.0.gep2 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 0, !dbg !599
store {} addrspace(10)* %0, {} addrspace(10)** %.fca.0.gep2, align 8, !dbg !599
%.fca.1.0.0.gep4 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 1, i64 0, i64 0, !dbg !599
store i64 1, i64* %.fca.1.0.0.gep4, align 8, !dbg !599
%.fca.1.0.1.gep6 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 1, i64 0, i64 1, !dbg !599
store i64 2, i64* %.fca.1.0.1.gep6, align 8, !dbg !599
%.fca.2.gep8 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 2, !dbg !599
store i64 0, i64* %.fca.2.gep8, align 8, !dbg !599
%.fca.3.gep10 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 3, !dbg !599
store i64 1, i64* %.fca.3.gep10, align 8, !dbg !599
%19 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !599
%.fca.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 0, !dbg !599
store {} addrspace(10)* %0, {} addrspace(10)** %.fca.0.gep, align 8, !dbg !599
%.fca.1.0.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 1, i64 0, i64 0, !dbg !599
store i64 1, i64* %.fca.1.0.0.gep, align 8, !dbg !599
%.fca.1.0.1.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 1, i64 0, i64 1, !dbg !599
store i64 2, i64* %.fca.1.0.1.gep, align 8, !dbg !599
%.fca.2.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 2, !dbg !599
store i64 0, i64* %.fca.2.gep, align 8, !dbg !599
%.fca.3.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 3, !dbg !599
store i64 1, i64* %.fca.3.gep, align 8, !dbg !599
%20 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !599
call fastcc void @julia__unsafe_setindex__2076({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly sret({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }) align 8 dereferenceable(40) %1, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %19, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %20, [1 x [1 x i64]] addrspace(11)* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef) #19, !dbg !599
call void @llvm.lifetime.end.p0i8(i64 noundef 40, i8* noundef nonnull %5) #20, !dbg !602
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %6) #20, !dbg !602
call void @llvm.lifetime.end.p0i8(i64 noundef 40, i8* noundef nonnull %7) #20, !dbg !602
call void @llvm.lifetime.end.p0i8(i64 noundef 40, i8* noundef nonnull %8) #20, !dbg !602
ret void, !dbg !603
}
after simplification :
; Function Attrs: mustprogress willreturn
define internal fastcc void @preprocess_julia__unsafe_setindex__2076({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly sret({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }) align 8 dereferenceable(40) %0, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3, [1 x [1 x i64]] addrspace(11)* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) %4) unnamed_addr #20 !dbg !626 {
top:
%5 = alloca [1 x i64], align 8
%6 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%7 = alloca [1 x i64], align 8
%8 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%9 = call {}*** @julia.get_pgcstack() #21
call void @llvm.dbg.declare(metadata { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, metadata !629, metadata !DIExpression(DW_OP_deref)) #21, !dbg !632
call void @llvm.dbg.declare(metadata { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, metadata !630, metadata !DIExpression(DW_OP_deref)) #21, !dbg !632
%.sroa.0126.0.copyload = load i64, i64 addrspace(11)* addrspacecast (i64* getelementptr inbounds ([1 x [1 x i64]], [1 x [1 x i64]]* @_j_const1, i32 0, i32 0, i32 0) to i64 addrspace(11)*), align 8, !tbaa !101
call void @llvm.dbg.value(metadata i64 %.sroa.0126.0.copyload, metadata !631, metadata !DIExpression()) #21, !dbg !633
%10 = call fastcc i8 @julia_mightalias_2101({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3) #22, !dbg !634, !range !402
%11 = and i8 %10, 1, !dbg !634
%.not = icmp eq i8 %11, 0, !dbg !634
br i1 %.not, label %L36, label %L3, !dbg !634
L3: ; preds = %top
%12 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 0, !dbg !636
%13 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 1, !dbg !641
%14 = load i64, i64 addrspace(11)* %13, align 8, !dbg !643, !tbaa !44, !invariant.load !4
%15 = load i64, i64 addrspace(11)* %12, align 8, !dbg !643, !tbaa !44, !invariant.load !4
%16 = add i64 %14, 1, !dbg !643
%17 = sub i64 %16, %15, !dbg !645
%18 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299958244480 to {}*) to {} addrspace(10)*), i64 %17) #21, !dbg !646
%19 = call fastcc nonnull {} addrspace(10)* @julia_copyto__2088({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %18, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3) #19, !dbg !649
%20 = sub i64 %14, %15, !dbg !650
%21 = add i64 %20, 1, !dbg !655
%22 = icmp ult i64 %20, 9223372036854775807, !dbg !656
%. = select i1 %22, i64 %21, i64 0, !dbg !661
%.fca.0.1.insert = insertvalue [1 x [2 x i64]] [[2 x i64] [i64 1, i64 undef]], i64 %., 0, 1, !dbg !666
br label %L37, !dbg !634
L36: ; preds = %top
%.elt = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 0
%.unpack = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %.elt, align 8
%.unpack136.unpack.elt = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 0
%.unpack136.unpack.unpack = load i64, i64 addrspace(11)* %.unpack136.unpack.elt, align 8
%23 = insertvalue [2 x i64] undef, i64 %.unpack136.unpack.unpack, 0
%.unpack136.unpack.elt142 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 1
%.unpack136.unpack.unpack143 = load i64, i64 addrspace(11)* %.unpack136.unpack.elt142, align 8
%.unpack136.unpack144 = insertvalue [2 x i64] %23, i64 %.unpack136.unpack.unpack143, 1
%.unpack136141 = insertvalue [1 x [2 x i64]] undef, [2 x i64] %.unpack136.unpack144, 0
%.elt137 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 2
%.unpack138 = load i64, i64 addrspace(11)* %.elt137, align 8
%.elt139 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 3
%.unpack140 = load i64, i64 addrspace(11)* %.elt139, align 8
br label %L37
L37: ; preds = %L36, %L3
%.pn150 = phi {} addrspace(10)* [ %18, %L3 ], [ %.unpack, %L36 ]
%.fca.0.1.insert.pn = phi [1 x [2 x i64]] [ %.fca.0.1.insert, %L3 ], [ %.unpack136141, %L36 ]
%.pn147 = phi i64 [ 0, %L3 ], [ %.unpack138, %L36 ]
%.pn145 = phi i64 [ 1, %L3 ], [ %.unpack140, %L36 ]
%.fca.0.0.extract117 = extractvalue [1 x [2 x i64]] %.fca.0.1.insert.pn, 0, 0, !dbg !667
%.fca.0.1.extract118 = extractvalue [1 x [2 x i64]] %.fca.0.1.insert.pn, 0, 1, !dbg !667
%24 = sub i64 %.fca.0.1.extract118, %.fca.0.0.extract117, !dbg !673
%25 = add i64 %24, 1, !dbg !677
%26 = icmp sgt i64 %25, 0, !dbg !678
%27 = select i1 %26, i64 %25, i64 0, !dbg !678
%.not132 = icmp eq i64 %27, %.sroa.0126.0.copyload, !dbg !683
br i1 %.not132, label %L56, label %L53, !dbg !671
L53: ; preds = %L37
%28 = getelementptr inbounds [1 x i64], [1 x i64]* %7, i64 0, i64 0, !dbg !671
store i64 %.sroa.0126.0.copyload, i64* %28, align 8, !dbg !671, !tbaa !478
%value_phi1.fca.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 0, !dbg !671
store {} addrspace(10)* %.pn150, {} addrspace(10)** %value_phi1.fca.0.gep, align 8, !dbg !671
%value_phi1.fca.1.0.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 1, i64 0, i64 0, !dbg !671
store i64 %.fca.0.0.extract117, i64* %value_phi1.fca.1.0.0.gep, align 8, !dbg !671
%value_phi1.fca.1.0.1.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 1, i64 0, i64 1, !dbg !671
store i64 %.fca.0.1.extract118, i64* %value_phi1.fca.1.0.1.gep, align 8, !dbg !671
%value_phi1.fca.2.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 2, !dbg !671
store i64 %.pn147, i64* %value_phi1.fca.2.gep, align 8, !dbg !671
%value_phi1.fca.3.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 3, !dbg !671
store i64 %.pn145, i64* %value_phi1.fca.3.gep, align 8, !dbg !671
%29 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !671
%30 = addrspacecast [1 x i64]* %7 to [1 x i64] addrspace(11)*, !dbg !671
%31 = call fastcc nonnull {} addrspace(10)* @julia_throw_setindex_mismatch_2084({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %29, [1 x i64] addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) %30) #23, !dbg !671
unreachable, !dbg !671
L56: ; preds = %L37
%32 = icmp ugt i64 %24, 9223372036854775806, !dbg !684
%33 = icmp slt i64 %.sroa.0126.0.copyload, 1
%or.cond = select i1 %32, i1 true, i1 %33, !dbg !696
br i1 %or.cond, label %L218, label %L151.lr.ph, !dbg !696
L122: ; preds = %L197
br i1 %.not133, label %L122.L218.loopexit_crit_edge, label %L151, !dbg !697
L151: ; preds = %L151.lr.ph, %L122
%iv = phi i64 [ 0, %L151.lr.ph ], [ %iv.next, %L122 ]
%34 = phi i64 [ undef, %L151.lr.ph ], [ %38, %L122 ]
%value_phi14163 = phi double [ %58, %L151.lr.ph ], [ %value_phi20, %L122 ]
%iv.next = add nuw nsw i64 %iv, 1, !dbg !700
%35 = add nsw i64 %iv.next, -1, !dbg !700
%36 = add i64 %35, %62, !dbg !703
%37 = getelementptr inbounds double, double addrspace(13)* %64, i64 %36, !dbg !703
store double %value_phi14163, double addrspace(13)* %37, align 8, !dbg !703, !tbaa !188
%.not133 = icmp eq i64 %iv.next, %25, !dbg !704
%38 = add nuw i64 %iv.next, 1, !dbg !705
br i1 %.not133, label %L197, label %L170, !dbg !708
L170: ; preds = %L151
%39 = icmp ugt i64 %iv.next, 9223372036854775806, !dbg !709
%40 = icmp sgt i64 %38, %.sroa.0126.0.copyload, !dbg !709
%41 = or i1 %39, %40, !dbg !712
br i1 %41, label %L186, label %L189, !dbg !712
L186: ; preds = %L170
store i64 %38, i64* %65, align 8, !dbg !715, !tbaa !478
%value_phi1.fca.0.gep81 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 0, !dbg !712
store {} addrspace(10)* %.pn150, {} addrspace(10)** %value_phi1.fca.0.gep81, align 8, !dbg !712
%value_phi1.fca.1.0.0.gep83 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 1, i64 0, i64 0, !dbg !712
store i64 %.fca.0.0.extract117, i64* %value_phi1.fca.1.0.0.gep83, align 8, !dbg !712
%value_phi1.fca.1.0.1.gep85 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 1, i64 0, i64 1, !dbg !712
store i64 %.fca.0.1.extract118, i64* %value_phi1.fca.1.0.1.gep85, align 8, !dbg !712
%value_phi1.fca.2.gep87 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 2, !dbg !712
store i64 %.pn147, i64* %value_phi1.fca.2.gep87, align 8, !dbg !712
%value_phi1.fca.3.gep89 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 3, !dbg !712
store i64 %.pn145, i64* %value_phi1.fca.3.gep89, align 8, !dbg !712
%42 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !712
%43 = addrspacecast [1 x i64]* %5 to [1 x i64] addrspace(11)*, !dbg !712
%44 = call fastcc nonnull {} addrspace(10)* @julia_throw_boundserror_2086({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %42, [1 x i64] addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) %43) #23, !dbg !712
unreachable, !dbg !712
L189: ; preds = %L170
%45 = add i64 %iv.next, %.pn147, !dbg !716
%46 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %67, align 8, !dbg !716, !tbaa !57, !nonnull !4
%47 = getelementptr inbounds double, double addrspace(13)* %46, i64 %45, !dbg !716
%48 = load double, double addrspace(13)* %47, align 8, !dbg !716, !tbaa !188
br label %L197, !dbg !718
L197: ; preds = %L189, %L151
%value_phi20 = phi double [ %48, %L189 ], [ undef, %L151 ]
%.not134 = icmp eq i64 %iv.next, %.sroa.0126.0.copyload, !dbg !720
br i1 %.not134, label %L197.L218.loopexit_crit_edge, label %L122, !dbg !723
L197.L218.loopexit_crit_edge: ; preds = %L197
store i64 %38, i64* %65, align 8, !dbg !715, !tbaa !478
br label %L218, !dbg !723
L122.L218.loopexit_crit_edge: ; preds = %L122
store i64 %38, i64* %65, align 8, !dbg !715, !tbaa !478
br label %L218, !dbg !697
L218: ; preds = %L122.L218.loopexit_crit_edge, %L197.L218.loopexit_crit_edge, %L56
%49 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 0, !dbg !724
%50 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %49, align 8, !dbg !724
%51 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !724
store {} addrspace(10)* %50, {} addrspace(10)** %51, align 8, !dbg !724
%52 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0 to i8*, !dbg !724
%53 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2 to i8 addrspace(11)*, !dbg !724
call void @llvm.memcpy.p0i8.p11i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %52, i8 addrspace(11)* nofree noundef nonnull align 8 dereferenceable(40) %53, i64 noundef 40, i1 noundef false) #21, !dbg !724
ret void, !dbg !724
L151.lr.ph: ; preds = %L56
%54 = bitcast {} addrspace(10)* %.pn150 to double addrspace(13)* addrspace(10)*, !dbg !725
%55 = addrspacecast double addrspace(13)* addrspace(10)* %54 to double addrspace(13)* addrspace(11)*, !dbg !725
%56 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %55, align 8, !dbg !725, !tbaa !57, !nonnull !4
%57 = getelementptr inbounds double, double addrspace(13)* %56, i64 %.pn147, !dbg !725
%58 = load double, double addrspace(13)* %57, align 8, !dbg !725, !tbaa !188
%59 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2 to double addrspace(13)* addrspace(10)* addrspace(11)*
%60 = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %59 unordered, align 8, !tbaa !44, !invariant.load !4, !nonnull !4, !dereferenceable !48, !align !49
%61 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 2
%62 = load i64, i64 addrspace(11)* %61, align 8, !tbaa !44, !invariant.load !4
%63 = addrspacecast double addrspace(13)* addrspace(10)* %60 to double addrspace(13)* addrspace(11)*
%64 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %63, align 16, !tbaa !57, !nonnull !4
%65 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%66 = bitcast {} addrspace(10)* %.pn150 to double addrspace(13)* addrspace(10)*
%67 = addrspacecast double addrspace(13)* addrspace(10)* %66 to double addrspace(13)* addrspace(11)*
br label %L151, !dbg !697
}
after simplification :
; Function Attrs: mustprogress willreturn
define internal fastcc nonnull align 16 dereferenceable(40) {} addrspace(10)* @preprocess_julia_copyto__2088({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1) unnamed_addr #21 !dbg !831 {
top:
%2 = call {}*** @julia.get_pgcstack() #22
%3 = bitcast {}*** %2 to {}**
%4 = getelementptr inbounds {}*, {}** %3, i64 -12
%5 = getelementptr inbounds {}*, {}** %4, i64 14
%6 = bitcast {}** %5 to i8**
%7 = load i8*, i8** %6, align 8
%8 = call noalias nonnull dereferenceable(40) dereferenceable_or_null(40) {} addrspace(10)* @julia.gc_alloc_obj({}** %4, i64 40, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299497158656 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !836
%9 = bitcast {} addrspace(10)* %8 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)*, !enzyme_caststack !4
%10 = bitcast {}*** %2 to {}**
%11 = getelementptr inbounds {}*, {}** %10, i64 -12
%12 = getelementptr inbounds {}*, {}** %11, i64 14
%13 = bitcast {}** %12 to i8**
%14 = load i8*, i8** %13, align 8
%15 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) {} addrspace(10)* @julia.gc_alloc_obj({}** %11, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299772271664 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !836
%16 = bitcast {} addrspace(10)* %15 to [1 x {} addrspace(10)*] addrspace(10)*, !enzyme_caststack !4
call void @llvm.dbg.value(metadata {} addrspace(10)* null, metadata !834, metadata !DIExpression(DW_OP_deref)) #22, !dbg !837
call void @llvm.dbg.value(metadata {} addrspace(10)* %0, metadata !834, metadata !DIExpression(DW_OP_deref)) #22, !dbg !837
call void @llvm.dbg.declare(metadata { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, metadata !835, metadata !DIExpression(DW_OP_deref)) #22, !dbg !838
%17 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 0, !dbg !839
%18 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 1, !dbg !849
%19 = load i64, i64 addrspace(11)* %18, align 8, !dbg !851, !tbaa !44, !invariant.load !4
%20 = load i64, i64 addrspace(11)* %17, align 8, !dbg !851, !tbaa !44, !invariant.load !4
%21 = sub i64 %19, %20, !dbg !851
%22 = icmp ult i64 %21, 9223372036854775807, !dbg !853
br i1 %22, label %L13, label %common.ret, !dbg !848
common.ret: ; preds = %L13, %top
ret {} addrspace(10)* undef, !dbg !837
L13: ; preds = %top
%23 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %9 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*, !dbg !858
%24 = addrspacecast [1 x {} addrspace(10)*] addrspace(10)* %16 to [1 x {} addrspace(10)*]*, !dbg !858
call fastcc void @julia_unalias_2095({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly sret({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }) align 8 dereferenceable(40) %23, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %24, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1) #19, !dbg !858
%25 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %9 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !859
%26 = call fastcc nonnull {} addrspace(10)* @julia_copyto_unaliased__2092({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %25) #19, !dbg !859
br label %common.ret
}
after simplification :
; Function Attrs: mustprogress willreturn
define internal fastcc noundef nonnull align 16 dereferenceable(40) {} addrspace(10)* @preprocess_julia_copyto_unaliased__2092({} addrspace(10)* noundef nonnull returned align 16 dereferenceable(40) %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1) unnamed_addr #23 !dbg !887 {
top:
%2 = call {}*** @julia.get_pgcstack() #24
call void @llvm.dbg.value(metadata {} addrspace(10)* null, metadata !891, metadata !DIExpression(DW_OP_deref)) #24, !dbg !894
call void @llvm.dbg.value(metadata {} addrspace(10)* %0, metadata !891, metadata !DIExpression(DW_OP_deref)) #24, !dbg !894
call void @llvm.dbg.declare(metadata { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, metadata !893, metadata !DIExpression(DW_OP_deref)) #24, !dbg !895
%3 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 0, !dbg !896
%4 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 1, !dbg !906
%5 = load i64, i64 addrspace(11)* %4, align 8, !dbg !908, !tbaa !44, !invariant.load !4
%6 = load i64, i64 addrspace(11)* %3, align 8, !dbg !908, !tbaa !44, !invariant.load !4
%7 = sub i64 %5, %6, !dbg !908
%8 = icmp ult i64 %7, 9223372036854775807, !dbg !910
br i1 %8, label %L13, label %common.ret, !dbg !905
common.ret.loopexit: ; preds = %L61
br label %common.ret, !dbg !894
common.ret: ; preds = %common.ret.loopexit, %top
ret {} addrspace(10)* %0, !dbg !894
L13: ; preds = %top
%9 = bitcast {} addrspace(10)* %0 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !915
%10 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %9 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !915
%11 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %10, i64 0, i32 1, !dbg !915
%12 = load i64, i64 addrspace(11)* %11, align 8, !dbg !915, !tbaa !162, !range !164
%13 = add nuw nsw i64 %7, 1, !dbg !919
%14 = icmp ne i64 %12, 0, !dbg !924
%15 = icmp slt i64 %7, %12, !dbg !924
%16 = and i1 %14, %15, !dbg !928
br i1 %16, label %L61.preheader, label %L110, !dbg !927
L61.preheader: ; preds = %L13
%17 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1 to double addrspace(13)* addrspace(10)* addrspace(11)*
%18 = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %17 unordered, align 8, !tbaa !44, !invariant.load !4, !nonnull !4, !dereferenceable !48, !align !49
%19 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 2
%20 = load i64, i64 addrspace(11)* %19, align 8, !tbaa !44, !invariant.load !4
%21 = addrspacecast double addrspace(13)* addrspace(10)* %18 to double addrspace(13)* addrspace(11)*
%22 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %21, align 16, !tbaa !57, !nonnull !4
%23 = bitcast {} addrspace(10)* %0 to double addrspace(13)* addrspace(10)*
%24 = addrspacecast double addrspace(13)* addrspace(10)* %23 to double addrspace(13)* addrspace(11)*
%25 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %24, align 16, !tbaa !57, !nonnull !4
br label %L61, !dbg !929
L61: ; preds = %L61, %L61.preheader
%iv = phi i64 [ %iv.next, %L61 ], [ 0, %L61.preheader ]
%iv.next = add nuw nsw i64 %iv, 1, !dbg !930
%26 = add i64 %iv.next, -1, !dbg !930
%27 = add i64 %26, %20, !dbg !933
%28 = getelementptr inbounds double, double addrspace(13)* %22, i64 %27, !dbg !933
%29 = load double, double addrspace(13)* %28, align 8, !dbg !933, !tbaa !188
%30 = getelementptr inbounds double, double addrspace(13)* %25, i64 %26, !dbg !934
store double %29, double addrspace(13)* %30, align 8, !dbg !934, !tbaa !188
%.not.not = icmp eq i64 %iv.next, %13, !dbg !935
%31 = add i64 %iv.next, 1, !dbg !936
br i1 %.not.not, label %common.ret.loopexit, label %L61, !dbg !929
L110: ; preds = %L13
%current_task818 = getelementptr inbounds {}**, {}*** %2, i64 -12, !dbg !927
%current_task8 = bitcast {}*** %current_task818 to {}**, !dbg !927
%32 = call noalias nonnull {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task8, i64 noundef 8, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299963483696 to {}*) to {} addrspace(10)*)) #25, !dbg !927
%.sroa.0.0..sroa_cast = bitcast {} addrspace(10)* %32 to i64 addrspace(10)*, !dbg !927
store i64 %13, i64 addrspace(10)* %.sroa.0.0..sroa_cast, align 8, !dbg !927, !tbaa !101
%33 = call cc38 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* @ijl_invoke to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299965929392 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299956141952 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %0, {} addrspace(10)* nonnull %32) #24, !dbg !927
%34 = addrspacecast {} addrspace(10)* %33 to {} addrspace(12)*, !dbg !927
call void @ijl_throw({} addrspace(12)* %34) #26, !dbg !927
unreachable, !dbg !927
}
; Function Attrs: mustprogress willreturn
define internal fastcc void @augmented_julia_copyto_unaliased__2092({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1") unnamed_addr #23 !dbg !938 {
top:
%"iv'ac" = alloca i64, align 8
%2 = call {}*** @julia.get_pgcstack() #24
%3 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 0, !dbg !945
%4 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 1, !dbg !955
%5 = load i64, i64 addrspace(11)* %4, align 8, !dbg !957, !tbaa !44, !invariant.load !4
%6 = load i64, i64 addrspace(11)* %3, align 8, !dbg !957, !tbaa !44, !invariant.load !4
%7 = sub i64 %5, %6, !dbg !957
%8 = icmp ult i64 %7, 9223372036854775807, !dbg !959
br i1 %8, label %L13, label %common.ret, !dbg !954
common.ret.loopexit: ; preds = %L61
br label %common.ret, !dbg !964
common.ret: ; preds = %common.ret.loopexit, %top
ret void, !dbg !964
L13: ; preds = %top
%9 = bitcast {} addrspace(10)* %0 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !965
%10 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %9 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !965
%11 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %10, i64 0, i32 1, !dbg !965
%12 = load i64, i64 addrspace(11)* %11, align 8, !dbg !965, !tbaa !162, !range !164
%13 = add nuw nsw i64 %7, 1, !dbg !969
%14 = icmp ne i64 %12, 0, !dbg !974
%15 = icmp slt i64 %7, %12, !dbg !974
%16 = and i1 %14, %15, !dbg !978
br i1 %16, label %L61.preheader, label %L110, !dbg !977
L61.preheader: ; preds = %L13
%"'ipc7" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1" to double addrspace(13)* addrspace(10)* addrspace(11)*
%17 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1 to double addrspace(13)* addrspace(10)* addrspace(11)*
%"'ipl8" = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %"'ipc7" unordered, align 8, !tbaa !44, !nonnull !4, !dereferenceable !48
%18 = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %17 unordered, align 8, !tbaa !44, !invariant.load !4, !nonnull !4, !dereferenceable !48, !align !49
%19 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 2
%20 = load i64, i64 addrspace(11)* %19, align 8, !tbaa !44, !invariant.load !4
%"'ipc5" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipl8" to double addrspace(13)* addrspace(11)*
%21 = addrspacecast double addrspace(13)* addrspace(10)* %18 to double addrspace(13)* addrspace(11)*
%"'ipl6" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc5", align 16, !tbaa !57, !nonnull !4
%22 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %21, align 16, !tbaa !57, !nonnull !4
%"'ipc" = bitcast {} addrspace(10)* %"'" to double addrspace(13)* addrspace(10)*
%23 = bitcast {} addrspace(10)* %0 to double addrspace(13)* addrspace(10)*
%"'ipc4" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc" to double addrspace(13)* addrspace(11)*
%24 = addrspacecast double addrspace(13)* addrspace(10)* %23 to double addrspace(13)* addrspace(11)*
%"'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc4", align 16, !tbaa !57, !nonnull !4
%25 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %24, align 16, !tbaa !57, !nonnull !4
br label %L61, !dbg !979
L61: ; preds = %L61, %L61.preheader
%iv = phi i64 [ %iv.next, %L61 ], [ 0, %L61.preheader ]
%iv.next = add nuw nsw i64 %iv, 1, !dbg !980
%26 = add i64 %iv.next, -1, !dbg !980
%27 = add i64 %26, %20, !dbg !983
%28 = getelementptr inbounds double, double addrspace(13)* %22, i64 %27, !dbg !983
%29 = load double, double addrspace(13)* %28, align 8, !dbg !983, !tbaa !188
%30 = getelementptr inbounds double, double addrspace(13)* %25, i64 %26, !dbg !984
store double %29, double addrspace(13)* %30, align 8, !dbg !984, !tbaa !188, !alias.scope !985, !noalias !988
%.not.not = icmp eq i64 %iv.next, %13, !dbg !990
br i1 %.not.not, label %common.ret.loopexit, label %L61, !dbg !979
L110: ; preds = %L13
%current_task818 = getelementptr inbounds {}**, {}*** %2, i64 -12, !dbg !977
%current_task8 = bitcast {}*** %current_task818 to {}**, !dbg !977
%31 = call noalias nonnull {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task8, i64 noundef 8, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299963483696 to {}*) to {} addrspace(10)*)) #25, !dbg !977
%.sroa.0.0..sroa_cast = bitcast {} addrspace(10)* %31 to i64 addrspace(10)*, !dbg !977
store i64 %13, i64 addrspace(10)* %.sroa.0.0..sroa_cast, align 8, !dbg !977, !tbaa !101
%32 = call cc38 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* @ijl_invoke to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299965929392 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299956141952 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %0, {} addrspace(10)* nonnull %31) #24, !dbg !977
%33 = addrspacecast {} addrspace(10)* %32 to {} addrspace(12)*, !dbg !977
call void @ijl_throw({} addrspace(12)* %33) #26, !dbg !977
unreachable, !dbg !977
}
after simplification :
; Function Attrs: mustprogress willreturn
define internal fastcc void @preprocess_julia_unalias_2095({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly sret({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }) align 8 dereferenceable(40) %0, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3) unnamed_addr #24 !dbg !993 {
top:
%4 = call {}*** @julia.get_pgcstack() #25
%5 = bitcast {}*** %4 to {}**
%6 = getelementptr inbounds {}*, {}** %5, i64 -12
%7 = getelementptr inbounds {}*, {}** %6, i64 14
%8 = bitcast {}** %7 to i8**
%9 = load i8*, i8** %8, align 8
%10 = call noalias nonnull dereferenceable(40) dereferenceable_or_null(40) {} addrspace(10)* @julia.gc_alloc_obj({}** %6, i64 40, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299497158656 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !836
%11 = bitcast {} addrspace(10)* %10 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)*, !enzyme_caststack !4
%12 = bitcast {}*** %4 to {}**
%13 = getelementptr inbounds {}*, {}** %12, i64 -12
%14 = getelementptr inbounds {}*, {}** %13, i64 14
%15 = bitcast {}** %14 to i8**
%16 = load i8*, i8** %15, align 8
%17 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) {} addrspace(10)* @julia.gc_alloc_obj({}** %13, i64 8, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299772271664 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !836
%18 = bitcast {} addrspace(10)* %17 to [1 x {} addrspace(10)*] addrspace(10)*, !enzyme_caststack !4
call void @llvm.dbg.value(metadata {} addrspace(10)* null, metadata !996, metadata !DIExpression(DW_OP_deref)) #25, !dbg !998
call void @llvm.dbg.value(metadata {} addrspace(10)* %2, metadata !996, metadata !DIExpression(DW_OP_deref)) #25, !dbg !998
call void @llvm.dbg.declare(metadata { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, metadata !997, metadata !DIExpression(DW_OP_deref)) #25, !dbg !999
%19 = load i8, i8* inttoptr (i64 140299958244536 to i8*), align 8, !dbg !1000, !tbaa !44, !invariant.load !4
%20 = and i8 %19, 8, !dbg !1002
%.not.not = icmp eq i8 %20, 0, !dbg !1002
br i1 %.not.not, label %L6, label %L26, !dbg !1002
L6: ; preds = %top
%21 = load i8, i8* inttoptr (i64 140299783854168 to i8*), align 8, !dbg !1000, !tbaa !44, !invariant.load !4
%22 = and i8 %21, 8, !dbg !1002
%.not.not1 = icmp eq i8 %22, 0, !dbg !1002
br i1 %.not.not1, label %L11, label %L26, !dbg !1002
L11: ; preds = %L6
%23 = addrspacecast {} addrspace(10)* %2 to {} addrspace(11)*, !dbg !1003
%24 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* noundef %23) #26, !dbg !1003
%25 = bitcast {}* %24 to i8**, !dbg !1003
%26 = load i8*, i8** %25, align 8, !dbg !1003, !tbaa !57, !nonnull !4
%27 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 0, !dbg !1006
%28 = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %27 unordered, align 8, !dbg !1006, !tbaa !44, !invariant.load !4, !nonnull !4, !dereferenceable !48, !align !49
%29 = addrspacecast {} addrspace(10)* %28 to {} addrspace(11)*, !dbg !1008
%30 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %29) #26, !dbg !1008
%31 = bitcast {}* %30 to i8**, !dbg !1008
%32 = load i8*, i8** %31, align 8, !dbg !1008, !tbaa !57, !nonnull !4
%.not = icmp eq i8* %26, %32, !dbg !1011
br i1 %.not, label %L24, label %L26, !dbg !999
common.ret: ; preds = %L26, %L24
ret void, !dbg !999
L24: ; preds = %L11
%33 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %11 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*, !dbg !999
%34 = addrspacecast [1 x {} addrspace(10)*] addrspace(10)* %18 to [1 x {} addrspace(10)*]*, !dbg !999
call fastcc void @julia_unaliascopy_2098({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly sret({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }) align 8 dereferenceable(40) %33, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %34, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3) #19, !dbg !999
%35 = getelementptr { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %11, i64 0, i32 0, !dbg !999
%36 = load {} addrspace(10)*, {} addrspace(10)* addrspace(10)* %35, align 8, !dbg !999
%37 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !999
store {} addrspace(10)* %36, {} addrspace(10)** %37, align 8, !dbg !999
%38 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0 to i8*, !dbg !999
%39 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %11 to i8 addrspace(10)*, !dbg !999
call void @llvm.memcpy.p0i8.p10i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %38, i8 addrspace(10)* noundef nonnull align 8 dereferenceable(40) %39, i64 noundef 40, i1 noundef false) #25, !dbg !999
br label %common.ret
L26: ; preds = %L11, %L6, %top
%40 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 0, !dbg !999
%41 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %40, align 8, !dbg !999
%42 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !999
store {} addrspace(10)* %41, {} addrspace(10)** %42, align 8, !dbg !999
%43 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0 to i8*, !dbg !999
%44 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3 to i8 addrspace(11)*, !dbg !999
call void @llvm.memcpy.p0i8.p11i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %43, i8 addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %44, i64 noundef 40, i1 noundef false) #25, !dbg !999
br label %common.ret
}
after simplification :
; Function Attrs: mustprogress willreturn
define internal fastcc void @preprocess_julia_unaliascopy_2098({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly sret({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }) align 8 dereferenceable(40) %0, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2) unnamed_addr #25 !dbg !1034 {
top:
%3 = call {}*** @julia.get_pgcstack() #26
call void @llvm.dbg.declare(metadata { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, metadata !1037, metadata !DIExpression(DW_OP_deref)) #26, !dbg !1038
%4 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 1, i64 0, i64 0, !dbg !1039
%5 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 1, i64 0, i64 1, !dbg !1044
%6 = load i64, i64 addrspace(11)* %5, align 8, !dbg !1046, !tbaa !44, !invariant.load !4
%7 = load i64, i64 addrspace(11)* %4, align 8, !dbg !1046, !tbaa !44, !invariant.load !4
%8 = add i64 %6, 1, !dbg !1046
%9 = sub i64 %8, %7, !dbg !1048
%10 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299958244480 to {}*) to {} addrspace(10)*), i64 %9) #26, !dbg !1049
%11 = call fastcc nonnull {} addrspace(10)* @julia_copyto__2088({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %10, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2) #19, !dbg !1052
%12 = sub i64 %6, %7, !dbg !1053
%13 = add i64 %12, 1, !dbg !1058
%14 = icmp ult i64 %12, 9223372036854775807, !dbg !1059
%. = select i1 %14, i64 %13, i64 0, !dbg !1064
%15 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !1057
store {} addrspace(10)* %10, {} addrspace(10)** %15, align 8, !dbg !1057
%.repack = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 0, !dbg !1057
store {} addrspace(10)* %10, {} addrspace(10)** %.repack, align 8, !dbg !1057
%.repack10 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 1, i64 0, i64 0, !dbg !1057
store i64 1, i64* %.repack10, align 8, !dbg !1057
%.repack11 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 1, i64 0, i64 1, !dbg !1057
store i64 %., i64* %.repack11, align 8, !dbg !1057
%.repack6 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 2, !dbg !1057
store i64 0, i64* %.repack6, align 8, !dbg !1057
%.repack8 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 3, !dbg !1057
store i64 1, i64* %.repack8, align 8, !dbg !1057
ret void, !dbg !1057
}
; Function Attrs: mustprogress willreturn
define internal fastcc { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } @augmented_julia_unaliascopy_2098({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) "enzyme_sret" %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* nocapture "enzyme_sret" %"'", [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1") unnamed_addr #25 !dbg !1069 {
top:
%3 = alloca { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, align 8, !dbg !1073
store { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } zeroinitializer, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %3, align 8, !dbg !1073
%4 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 1, i64 0, i64 0, !dbg !1073
%5 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 1, i64 0, i64 1, !dbg !1078
%6 = load i64, i64 addrspace(11)* %5, align 8, !dbg !1080, !tbaa !44, !invariant.load !4
%7 = load i64, i64 addrspace(11)* %4, align 8, !dbg !1080, !tbaa !44, !invariant.load !4
%8 = add i64 %6, 1, !dbg !1080
%9 = sub i64 %8, %7, !dbg !1082
%10 = getelementptr inbounds { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %3, i32 0, i32 3, !dbg !1083
store i64 %9, i64* %10, align 8, !dbg !1083
%11 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299958244480 to {}*) to {} addrspace(10)*), i64 %9) #26, !dbg !1083
%12 = getelementptr inbounds { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %3, i32 0, i32 2, !dbg !1083
store {} addrspace(10)* %11, {} addrspace(10)** %12, align 8, !dbg !1083
%13 = call {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299958244480 to {}*) to {} addrspace(10)*), i64 %9), !dbg !1083
%14 = getelementptr inbounds { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %3, i32 0, i32 1, !dbg !1083
store {} addrspace(10)* %13, {} addrspace(10)** %14, align 8, !dbg !1083
%15 = mul i64 %9, 8, !dbg !1083
%16 = bitcast {} addrspace(10)* %13 to i8 addrspace(13)* addrspace(10)*, !dbg !1083
%17 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(10)* %16, align 8, !dbg !1083
call void @llvm.memset.p13i8.i64(i8 addrspace(13)* align 1 %17, i8 0, i64 %15, i1 false), !dbg !1083
%_augmented = call fastcc { {} addrspace(10)* } @fakeaugmented_julia_copyto__2088({} addrspace(10)* %11, {} addrspace(10)* %13, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1"), !dbg !1086
%subcache = extractvalue { {} addrspace(10)* } %_augmented, 0, !dbg !1086
%18 = getelementptr inbounds { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %3, i32 0, i32 0, !dbg !1087
store {} addrspace(10)* %subcache, {} addrspace(10)** %18, align 8, !dbg !1087
%19 = sub i64 %6, %7, !dbg !1087
%20 = add i64 %19, 1, !dbg !1092
%21 = icmp ult i64 %19, 9223372036854775807, !dbg !1093
%. = select i1 %21, i64 %20, i64 0, !dbg !1098
%22 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !1091
store {} addrspace(10)* %11, {} addrspace(10)** %22, align 8, !dbg !1091
%".repack'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'", i64 0, i32 0, !dbg !1091
%.repack = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 0, !dbg !1091
store {} addrspace(10)* %13, {} addrspace(10)** %".repack'ipg", align 8, !dbg !1091, !alias.scope !1103, !noalias !1106
store {} addrspace(10)* %11, {} addrspace(10)** %.repack, align 8, !dbg !1091, !alias.scope !1106, !noalias !1103
%".repack10'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'", i64 0, i32 1, i64 0, i64 0, !dbg !1091
%.repack10 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 1, i64 0, i64 0, !dbg !1091
store i64 1, i64* %".repack10'ipg", align 8, !dbg !1091, !alias.scope !1103, !noalias !1106
store i64 1, i64* %.repack10, align 8, !dbg !1091, !alias.scope !1106, !noalias !1103
%".repack11'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'", i64 0, i32 1, i64 0, i64 1, !dbg !1091
%.repack11 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 1, i64 0, i64 1, !dbg !1091
store i64 %., i64* %".repack11'ipg", align 8, !dbg !1091, !alias.scope !1103, !noalias !1106
store i64 %., i64* %.repack11, align 8, !dbg !1091, !alias.scope !1106, !noalias !1103
%".repack6'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'", i64 0, i32 2, !dbg !1091
%.repack6 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 2, !dbg !1091
store i64 0, i64* %".repack6'ipg", align 8, !dbg !1091, !alias.scope !1103, !noalias !1106
store i64 0, i64* %.repack6, align 8, !dbg !1091, !alias.scope !1106, !noalias !1103
%".repack8'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'", i64 0, i32 3, !dbg !1091
%.repack8 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0, i64 0, i32 3, !dbg !1091
store i64 1, i64* %".repack8'ipg", align 8, !dbg !1091, !alias.scope !1103, !noalias !1106
store i64 1, i64* %.repack8, align 8, !dbg !1091, !alias.scope !1106, !noalias !1103
%23 = load { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %3, align 8, !dbg !1091
ret { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %23, !dbg !1091
}
; Function Attrs: mustprogress willreturn
define internal fastcc { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } @augmented_julia_unalias_2095({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) "enzyme_sret" %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* nocapture "enzyme_sret" %"'", [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %2, {} addrspace(10)* %"'1", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'2") unnamed_addr #24 !dbg !1088 {
top:
%4 = alloca { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, align 8
store { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } zeroinitializer, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, align 8
%5 = alloca [1 x {} addrspace(10)*], i64 1, align 8
%6 = bitcast [1 x {} addrspace(10)*]* %5 to {}*
%7 = bitcast [1 x {} addrspace(10)*]* %5 to {}*
%8 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, i64 1, align 8
%9 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8 to {}*
%10 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8 to {}*
%11 = call {}*** @julia.get_pgcstack() #26
%12 = bitcast {}*** %11 to {}**
%13 = getelementptr inbounds {}*, {}** %12, i64 -12
%"'mi" = call noalias nonnull dereferenceable(40) dereferenceable_or_null(40) {} addrspace(10)* @julia.gc_alloc_obj({}** %13, i64 40, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299497158656 to {}*) to {} addrspace(10)*))
%14 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, i32 0, i32 0
store {} addrspace(10)* %"'mi", {} addrspace(10)** %14, align 8
%15 = bitcast {} addrspace(10)* %"'mi" to i8 addrspace(10)*
call void @llvm.memset.p10i8.i64(i8 addrspace(10)* nonnull dereferenceable(40) dereferenceable_or_null(40) %15, i8 0, i64 40, i1 false)
%"'ipc15" = bitcast {} addrspace(10)* %"'mi" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)*
%16 = bitcast {}* %9 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*
%17 = bitcast {}*** %11 to {}**
%18 = getelementptr inbounds {}*, {}** %17, i64 -12
%19 = bitcast {}* %6 to [1 x {} addrspace(10)*]*
%20 = load i8, i8* inttoptr (i64 140299958244536 to i8*), align 8, !dbg !1093, !tbaa !44, !invariant.load !4
%21 = and i8 %20, 8, !dbg !1095
%.not.not = icmp eq i8 %21, 0, !dbg !1095
%22 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, i32 0, i32 2, !dbg !1095
store i1 %.not.not, i1* %22, align 1, !dbg !1095
br i1 %.not.not, label %L6, label %L26, !dbg !1095
L6: ; preds = %top
%23 = load i8, i8* inttoptr (i64 140299783854168 to i8*), align 8, !dbg !1093, !tbaa !44, !invariant.load !4
%24 = and i8 %23, 8, !dbg !1095
%.not.not1 = icmp eq i8 %24, 0, !dbg !1095
%25 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, i32 0, i32 3, !dbg !1095
store i1 %.not.not1, i1* %25, align 1, !dbg !1095
br i1 %.not.not1, label %L11, label %L26, !dbg !1095
L11: ; preds = %L6
%26 = addrspacecast {} addrspace(10)* %2 to {} addrspace(11)*, !dbg !1097
%27 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* noundef %26) #27, !dbg !1097
%28 = bitcast {}* %27 to i8**, !dbg !1097
%29 = load i8*, i8** %28, align 8, !dbg !1097, !tbaa !57, !nonnull !4
%30 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 0, !dbg !1100
%31 = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %30 unordered, align 8, !dbg !1100, !tbaa !44, !invariant.load !4, !nonnull !4, !dereferenceable !48, !align !49
%32 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, i32 0, i32 4, !dbg !1102
store {} addrspace(10)* %31, {} addrspace(10)** %32, align 8, !dbg !1102
%33 = addrspacecast {} addrspace(10)* %31 to {} addrspace(11)*, !dbg !1102
%34 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %33) #27, !dbg !1102
%35 = bitcast {}* %34 to i8**, !dbg !1102
%36 = load i8*, i8** %35, align 8, !dbg !1102, !tbaa !57, !nonnull !4
%.not = icmp eq i8* %29, %36, !dbg !1105
%37 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, i32 0, i32 5, !dbg !1096
store i1 %.not, i1* %37, align 1, !dbg !1096
br i1 %.not, label %L24, label %L26, !dbg !1096
common.ret: ; preds = %L26, %L24
%38 = load { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, align 8, !dbg !1096
ret { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %38, !dbg !1096
L24: ; preds = %L11
%"'ipc17" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %"'ipc15" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*, !dbg !1096
%_augmented = call fastcc { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } @augmented_julia_unaliascopy_2098({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %16, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %"'ipc17", [1 x {} addrspace(10)*]* %19, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'2"), !dbg !1096
%39 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }* %4, i32 0, i32 1, !dbg !1096
store { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %_augmented, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }* %39, align 8, !dbg !1096
%40 = getelementptr { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %16, i64 0, i32 0, !dbg !1096
%41 = load {} addrspace(10)*, {} addrspace(10)** %40, align 8, !dbg !1096
%42 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !1096
store {} addrspace(10)* %41, {} addrspace(10)** %42, align 8, !dbg !1096
%"'ipc" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'" to i8*, !dbg !1096
%43 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0 to i8*, !dbg !1096
%"'ipc16" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %"'ipc15" to i8 addrspace(10)*, !dbg !1096
%44 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %16 to i8*, !dbg !1096
call void @llvm.memcpy.p0i8.p10i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %"'ipc", i8 addrspace(10)* noundef nonnull align 8 dereferenceable(40) %"'ipc16", i64 noundef 40, i1 noundef false) #26, !dbg !1096
call void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %43, i8* noundef nonnull align 8 dereferenceable(40) %44, i64 noundef 40, i1 noundef false) #26, !dbg !1096
br label %common.ret
L26: ; preds = %L11, %L6, %top
%45 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 0, !dbg !1096
%46 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %45, align 8, !dbg !1096
%47 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !1096
store {} addrspace(10)* %46, {} addrspace(10)** %47, align 8, !dbg !1096
%"'ipc18" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'" to i8*, !dbg !1096
%48 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0 to i8*, !dbg !1096
%"'ipc19" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'2" to i8 addrspace(11)*, !dbg !1096
%49 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3 to i8 addrspace(11)*, !dbg !1096
call void @llvm.memcpy.p0i8.p11i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %"'ipc18", i8 addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %"'ipc19", i64 noundef 40, i1 noundef false) #26, !dbg !1096
call void @llvm.memcpy.p0i8.p11i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %48, i8 addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %49, i64 noundef 40, i1 noundef false) #26, !dbg !1096
br label %common.ret
}
; Function Attrs: mustprogress willreturn
define internal fastcc {} addrspace(10)* @augmented_julia_copyto__2088({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1") unnamed_addr #21 !dbg !1081 {
top:
%2 = call {}*** @julia.get_pgcstack() #26
%3 = alloca {} addrspace(10)*, align 8
store {} addrspace(10)* null, {} addrspace(10)** %3, align 8
%4 = bitcast {}*** %2 to {}**
%5 = getelementptr inbounds {}*, {}** %4, i64 -12
%6 = getelementptr inbounds {}*, {}** %5, i64 14
%7 = bitcast {}** %6 to i8**
%8 = load i8*, i8** %7, align 8
%9 = call noalias nonnull dereferenceable(80) dereferenceable_or_null(80) {} addrspace(10)* @julia.gc_alloc_obj({}** %5, i64 80, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299746036320 to {}*) to {} addrspace(10)*))
%10 = bitcast {} addrspace(10)* %9 to i8 addrspace(10)*, !enzyme_formemset !4
call void @llvm.memset.p10i8.i64(i8 addrspace(10)* %10, i8 0, i64 80, i1 false)
%tapemem = bitcast {} addrspace(10)* %9 to { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)*
store {} addrspace(10)* %9, {} addrspace(10)** %3, align 8
%11 = alloca [1 x {} addrspace(10)*], i64 1, align 8
%12 = bitcast [1 x {} addrspace(10)*]* %11 to {}*
%13 = bitcast [1 x {} addrspace(10)*]* %11 to {}*
%14 = bitcast {}*** %2 to {}**
%15 = getelementptr inbounds {}*, {}** %14, i64 -12
%16 = call noalias nonnull dereferenceable(40) dereferenceable_or_null(40) {} addrspace(10)* @julia.gc_alloc_obj({}** %15, i64 40, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299497158656 to {}*) to {} addrspace(10)*)), !enzyme_fromstack !836
%17 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)* %tapemem, i32 0, i32 0
store {} addrspace(10)* %16, {} addrspace(10)* addrspace(10)* %17, align 8
call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* %9, {} addrspace(10)* %16)
%"'ai" = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, i64 1, align 8
%18 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ai" to {}*
%19 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ai" to {}*
%20 = bitcast {}* %18 to i8*
call void @llvm.memset.p0i8.i64(i8* nonnull dereferenceable(40) dereferenceable_or_null(40) %20, i8 0, i64 40, i1 false)
%"'ipc" = bitcast {}* %18 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*
%21 = bitcast {} addrspace(10)* %16 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)*, !enzyme_caststack !4
%22 = bitcast {}*** %2 to {}**
%23 = getelementptr inbounds {}*, {}** %22, i64 -12
%24 = bitcast {}* %12 to [1 x {} addrspace(10)*]*
%25 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 0, !dbg !1086
%26 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 1, !dbg !1096
%27 = load i64, i64 addrspace(11)* %26, align 8, !dbg !1098, !tbaa !44, !invariant.load !4
%28 = load i64, i64 addrspace(11)* %25, align 8, !dbg !1098, !tbaa !44, !invariant.load !4
%29 = sub i64 %27, %28, !dbg !1098
%30 = icmp ult i64 %29, 9223372036854775807, !dbg !1100
%31 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)* %tapemem, i32 0, i32 2, !dbg !1095
store i1 %30, i1 addrspace(10)* %31, align 1, !dbg !1095
br i1 %30, label %L13, label %common.ret, !dbg !1095
common.ret: ; preds = %L13, %top
%32 = load {} addrspace(10)*, {} addrspace(10)** %3, align 8, !dbg !1105
ret {} addrspace(10)* %32, !dbg !1105
L13: ; preds = %top
%33 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %21 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*, !dbg !1106
%_augmented = call fastcc { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } @augmented_julia_unalias_2095({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %33, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %"'ipc", [1 x {} addrspace(10)*]* %24, {} addrspace(10)* %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1"), !dbg !1106
%34 = getelementptr inbounds { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)* %tapemem, i32 0, i32 1, !dbg !1107
store { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %_augmented, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } addrspace(10)* %34, align 8, !dbg !1107
%35 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %_augmented, 0, !dbg !1107
%36 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %_augmented, 1, !dbg !1107
%37 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %_augmented, 4, !dbg !1107
%38 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %36, 0, !dbg !1107
%39 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %36, 1, !dbg !1107
%40 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %36, 2, !dbg !1107
call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* %9, {} addrspace(10)* %37, {} addrspace(10)* %40, {} addrspace(10)* %39, {} addrspace(10)* %38, {} addrspace(10)* %35), !dbg !1107
%"'ipc8" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipc" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !1107
%41 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %21 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !1107
call fastcc void @augmented_julia_copyto_unaliased__2092({} addrspace(10)* %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %41, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'ipc8"), !dbg !1107
br label %common.ret
}
; Function Attrs: mustprogress willreturn
define internal fastcc void @diffejulia_copyto_unaliased__2092({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1") unnamed_addr #23 !dbg !1135 {
top:
%"iv'ac" = alloca i64, align 8
%"'de" = alloca double, align 8
store double 0.000000e+00, double* %"'de", align 8
%2 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 0, !dbg !1142
%3 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 1, i64 0, i64 1, !dbg !1152
%4 = load i64, i64 addrspace(11)* %3, align 8, !dbg !1154, !tbaa !44, !invariant.load !4
%5 = load i64, i64 addrspace(11)* %2, align 8, !dbg !1154, !tbaa !44, !invariant.load !4
%6 = sub i64 %4, %5, !dbg !1154
%7 = icmp ult i64 %6, 9223372036854775807, !dbg !1156
br i1 %7, label %L13, label %common.ret, !dbg !1151
common.ret.loopexit: ; preds = %L61
br label %common.ret, !dbg !1161
common.ret: ; preds = %common.ret.loopexit, %top
br label %invertcommon.ret, !dbg !1161
L13: ; preds = %top
%8 = add nuw nsw i64 %6, 1, !dbg !1162
br i1 true, label %L61.preheader, label %L110, !dbg !1169
L61.preheader: ; preds = %L13
%"'ipc19" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1" to double addrspace(13)* addrspace(10)* addrspace(11)*
%"'ipl20" = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %"'ipc19" unordered, align 8, !tbaa !44, !nonnull !4, !dereferenceable !48, !invariant.group !1170
%9 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 2
%10 = load i64, i64 addrspace(11)* %9, align 8, !tbaa !44, !invariant.load !4, !invariant.group !1171
%"'ipc15" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipl20" to double addrspace(13)* addrspace(11)*
%"'ipl16" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc15", align 16, !tbaa !57, !nonnull !4, !invariant.group !1172
%"'ipc" = bitcast {} addrspace(10)* %"'" to double addrspace(13)* addrspace(10)*
%"'ipc11" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc" to double addrspace(13)* addrspace(11)*
%"'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc11", align 16, !tbaa !57, !nonnull !4, !invariant.group !1173
br label %L61, !dbg !1174
L61: ; preds = %L61, %L61.preheader
%iv = phi i64 [ %iv.next, %L61 ], [ 0, %L61.preheader ]
%iv.next = add nuw nsw i64 %iv, 1, !dbg !1175
%11 = add i64 %iv.next, -1, !dbg !1175
%12 = add i64 %11, %10, !dbg !1178
%"'ipg25" = getelementptr inbounds double, double addrspace(13)* %"'ipl16", i64 %12, !dbg !1178
%"'ipg" = getelementptr inbounds double, double addrspace(13)* %"'ipl", i64 %11, !dbg !1179
%.not.not = icmp eq i64 %iv.next, %8, !dbg !1180
br i1 %.not.not, label %common.ret.loopexit, label %L61, !dbg !1174
L110: ; preds = %L13
unreachable
inverttop: ; preds = %invertL13, %invertcommon.ret
ret void
invertcommon.ret.loopexit: ; preds = %invertcommon.ret
br label %mergeinvertL61_common.ret.loopexit
mergeinvertL61_common.ret.loopexit: ; preds = %invertcommon.ret.loopexit
store i64 %6, i64* %"iv'ac", align 8
br label %invertL61
invertcommon.ret: ; preds = %common.ret
br i1 %7, label %invertcommon.ret.loopexit, label %inverttop
invertL13: ; preds = %invertL61.preheader
br label %inverttop
invertL61.preheader: ; preds = %invertL61
br label %invertL13
invertL61: ; preds = %incinvertL61, %mergeinvertL61_common.ret.loopexit
%13 = load i64, i64* %"iv'ac", align 8
%"'ipc_unwrap" = bitcast {} addrspace(10)* %"'" to double addrspace(13)* addrspace(10)*
%"'ipc11_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc_unwrap" to double addrspace(13)* addrspace(11)*
%"'ipl_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc11_unwrap", align 16, !tbaa !57, !nonnull !4, !invariant.group !1173
%iv.next_unwrap = add nuw nsw i64 %13, 1
%_unwrap = add i64 %iv.next_unwrap, -1
%"'ipg_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'ipl_unwrap", i64 %_unwrap
%14 = load double, double addrspace(13)* %"'ipg_unwrap", align 8
store double 0.000000e+00, double addrspace(13)* %"'ipg_unwrap", align 8, !dbg !1179, !tbaa !188, !alias.scope !1183, !noalias !1186
%15 = load double, double* %"'de", align 8
%16 = fadd fast double %15, %14
store double %16, double* %"'de", align 8
%17 = load double, double* %"'de", align 8
store double 0.000000e+00, double* %"'de", align 8
%18 = load i64, i64* %"iv'ac", align 8
%"'ipc19_unwrap" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1" to double addrspace(13)* addrspace(10)* addrspace(11)*
%"'ipl20_unwrap" = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %"'ipc19_unwrap" unordered, align 8, !tbaa !44, !nonnull !4, !dereferenceable !48, !invariant.group !1170
%"'ipc15_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipl20_unwrap" to double addrspace(13)* addrspace(11)*
%"'ipl16_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc15_unwrap", align 16, !tbaa !57, !nonnull !4, !invariant.group !1172
%_unwrap26 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, i64 0, i32 2
%_unwrap27 = load i64, i64 addrspace(11)* %_unwrap26, align 8, !tbaa !44, !invariant.group !1171
%_unwrap28 = add i64 %_unwrap, %_unwrap27
%"'ipg25_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'ipl16_unwrap", i64 %_unwrap28
%19 = load double, double addrspace(13)* %"'ipg25_unwrap", align 8, !dbg !1178, !tbaa !188, !alias.scope !1183, !noalias !1186
%20 = fadd fast double %19, %17
store double %20, double addrspace(13)* %"'ipg25_unwrap", align 8, !dbg !1178, !tbaa !188, !alias.scope !1183, !noalias !1186
%21 = load i64, i64* %"iv'ac", align 8
%22 = icmp eq i64 %21, 0
%23 = xor i1 %22, true
br i1 %22, label %invertL61.preheader, label %incinvertL61
incinvertL61: ; preds = %invertL61
%24 = load i64, i64* %"iv'ac", align 8
%25 = add nsw i64 %24, -1
store i64 %25, i64* %"iv'ac", align 8
br label %invertL61
}
; Function Attrs: mustprogress willreturn
define internal fastcc void @diffejulia_unaliascopy_2098({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) "enzyme_sret" %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* nocapture "enzyme_sret" %"'", [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1", { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %tapeArg) unnamed_addr #25 !dbg !1209 {
top:
%3 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %tapeArg, 3, !dbg !1213
%4 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %tapeArg, 2, !dbg !1213
%5 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %tapeArg, 1, !dbg !1213
%tapeArg5 = extractvalue { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %tapeArg, 0, !dbg !1217
%6 = bitcast {} addrspace(10)* %tapeArg5 to { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)*, !dbg !1218
%tapeld = load { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)* %6, align 8, !dbg !1218, !enzyme_mustcache !4
br label %inverttop, !dbg !1222
inverttop: ; preds = %top
call fastcc void @diffejulia_copyto__2088({} addrspace(10)* %4, {} addrspace(10)* %5, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1", { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeld), !dbg !1217
ret void
}
; Function Attrs: mustprogress willreturn
define internal fastcc void @diffejulia_unalias_2095({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) "enzyme_sret" %0, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* nocapture "enzyme_sret" %"'", [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %2, {} addrspace(10)* %"'1", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'2", { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg) unnamed_addr #24 !dbg !1188 {
top:
%_cache = alloca i1, align 1
store i1 false, i1* %_cache, align 1
%4 = call {}*** @julia.get_pgcstack() #26
%5 = bitcast {}*** %4 to {}**
%6 = getelementptr inbounds {}*, {}** %5, i64 -12
%"'mi" = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 0
%"'ipc" = bitcast {} addrspace(10)* %"'mi" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)*
%.not.not = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 2, !dbg !1193
br i1 %.not.not, label %L6, label %L26, !dbg !1193
L6: ; preds = %top
%.not.not1 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 3, !dbg !1193
br i1 %.not.not1, label %L11, label %L26, !dbg !1193
L11: ; preds = %L6
%7 = addrspacecast {} addrspace(10)* %2 to {} addrspace(11)*, !dbg !1195
%8 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 4, !dbg !1198
%9 = addrspacecast {} addrspace(10)* %8 to {} addrspace(11)*, !dbg !1198
%.not = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 5, !dbg !1194
br i1 %.not, label %L24, label %L26, !dbg !1194
common.ret: ; preds = %L26, %L24
br label %invertcommon.ret, !dbg !1194
L24: ; preds = %L11
%"'ipc37" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %"'ipc" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*, !dbg !1194
%tapeArg38 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 1, !dbg !1194
store i1 false, i1* %_cache, align 1, !invariant.group !1202
br label %common.ret
L26: ; preds = %L11, %L6, %top
%"'ipc41" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'" to i8*, !dbg !1194
%"'ipc42" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'2" to i8 addrspace(11)*, !dbg !1194
store i1 true, i1* %_cache, align 1, !invariant.group !1202
br label %common.ret
inverttop: ; preds = %invertL26, %invertL6
ret void
invertL6: ; preds = %staging, %invertL11
br label %inverttop
invertL11: ; preds = %staging, %invertL24
br label %invertL6
invertcommon.ret: ; preds = %common.ret
%10 = load i1, i1* %_cache, align 1, !invariant.group !1202
br i1 %10, label %invertL26, label %invertL24
invertL24: ; preds = %invertcommon.ret
%"'ipc37_unwrap" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %"'ipc" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*
%tapeArg38_unwrap = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 1
call fastcc void @diffejulia_unaliascopy_2098({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" null, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %"'ipc37_unwrap", [1 x {} addrspace(10)*]* null, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'2", { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 } %tapeArg38_unwrap), !dbg !1194
br label %invertL11
invertL26: ; preds = %invertcommon.ret
%.not.not1_unwrap = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg, 3
br i1 %.not.not, label %staging, label %inverttop
staging: ; preds = %invertL26
br i1 %.not.not1_unwrap, label %invertL11, label %invertL6
}
; Function Attrs: mustprogress willreturn
define internal fastcc void @diffejulia_copyto__2088({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1", { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeArg) unnamed_addr #21 !dbg !1108 {
top:
%2 = call {}*** @julia.get_pgcstack() #26
%3 = bitcast {}*** %2 to {}**
%4 = getelementptr inbounds {}*, {}** %3, i64 -12
%5 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeArg, 0
%"'ai" = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, i64 1, align 8
%6 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ai" to {}*
%7 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ai" to {}*
%8 = bitcast {}* %6 to i8*
call void @llvm.memset.p0i8.i64(i8* nonnull dereferenceable(40) dereferenceable_or_null(40) %8, i8 0, i64 40, i1 false)
%"'ipc" = bitcast {}* %6 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }*
%9 = bitcast {} addrspace(10)* %5 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)*, !enzyme_caststack !4
%10 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeArg, 2, !dbg !1113
br i1 %10, label %L13, label %common.ret, !dbg !1113
common.ret: ; preds = %L13, %top
br label %invertcommon.ret, !dbg !1114
L13: ; preds = %top
%tapeArg20 = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeArg, 1, !dbg !1115
%"'ipc17" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipc" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !1116
%11 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %9 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !1116
br label %common.ret
inverttop: ; preds = %invertL13, %invertcommon.ret
ret void
invertcommon.ret: ; preds = %common.ret
br i1 %10, label %invertL13, label %inverttop
invertL13: ; preds = %invertcommon.ret
%_unwrap = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(10)* %9 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*
%"'ipc17_unwrap" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipc" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*
call fastcc void @diffejulia_copyto_unaliased__2092({} addrspace(10)* %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %_unwrap, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'ipc17_unwrap"), !dbg !1116
%tapeArg20_unwrap = extractvalue { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeArg, 1
call fastcc void @diffejulia_unalias_2095({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" null, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %"'ipc", [1 x {} addrspace(10)*]* null, {} addrspace(10)* %0, {} addrspace(10)* %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1", { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 } %tapeArg20_unwrap), !dbg !1115
br label %inverttop
}
; Function Attrs: mustprogress willreturn
define internal fastcc void @diffejulia__unsafe_setindex__2076({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) "enzyme_sret" %0, [1 x {} addrspace(10)*]* noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture %"'1", [1 x [1 x i64]] addrspace(11)* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) %4) unnamed_addr #20 !dbg !728 {
top:
%"iv'ac" = alloca i64, align 8
%loopLimit_cache = alloca i64, align 8
store i64 0, i64* %loopLimit_cache, align 8
%_cache = alloca {} addrspace(10)*, align 8
store {} addrspace(10)* null, {} addrspace(10)** %_cache, align 8
%"'mi_cache" = alloca {} addrspace(10)*, align 8
store {} addrspace(10)* null, {} addrspace(10)** %"'mi_cache", align 8
%tapeld_cache = alloca { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, align 1
store { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } zeroinitializer, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }* %tapeld_cache, align 8
%"value_phi14163'de" = alloca double, align 8
store double 0.000000e+00, double* %"value_phi14163'de", align 8
%"'de" = alloca double, align 8
store double 0.000000e+00, double* %"'de", align 8
%"value_phi20'de" = alloca double, align 8
store double 0.000000e+00, double* %"value_phi20'de", align 8
%"'de13" = alloca double, align 8
store double 0.000000e+00, double* %"'de13", align 8
%_cache20 = alloca i8, align 1
store i8 0, i8* %_cache20, align 1
%5 = alloca [1 x i64], align 8
%6 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%7 = alloca [1 x i64], align 8
%8 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%.sroa.0126.0.copyload = load i64, i64 addrspace(11)* addrspacecast (i64* getelementptr inbounds ([1 x [1 x i64]], [1 x [1 x i64]]* @_j_const1, i32 0, i32 0, i32 0) to i64 addrspace(11)*), align 8, !tbaa !101
%9 = call fastcc i8 @julia_mightalias_2101({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %3) #26, !dbg !734, !range !402
%10 = and i8 %9, 1, !dbg !734
%.not = icmp eq i8 %10, 0, !dbg !734
br i1 %.not, label %L36, label %L3, !dbg !734
L3: ; preds = %top
%11 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 0, !dbg !736
%12 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 1, !dbg !741
%13 = load i64, i64 addrspace(11)* %12, align 8, !dbg !743, !tbaa !44, !invariant.load !4
%14 = load i64, i64 addrspace(11)* %11, align 8, !dbg !743, !tbaa !44, !invariant.load !4
%15 = add i64 %13, 1, !dbg !743
%16 = sub i64 %15, %14, !dbg !745
%17 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299958244480 to {}*) to {} addrspace(10)*), i64 %16) #27, !dbg !746
store {} addrspace(10)* %17, {} addrspace(10)** %_cache, align 8, !dbg !746, !invariant.group !749
%18 = call {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299958244480 to {}*) to {} addrspace(10)*), i64 %16), !dbg !746
%19 = mul i64 %16, 8, !dbg !746
%20 = bitcast {} addrspace(10)* %18 to i8 addrspace(13)* addrspace(10)*, !dbg !746
%21 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(10)* %20, align 8, !dbg !746
call void @llvm.memset.p13i8.i64(i8 addrspace(13)* align 1 %21, i8 0, i64 %19, i1 false), !dbg !746
store {} addrspace(10)* %18, {} addrspace(10)** %"'mi_cache", align 8, !dbg !750, !invariant.group !751
%_augmented = call fastcc {} addrspace(10)* @augmented_julia_copyto__2088({} addrspace(10)* %17, {} addrspace(10)* %18, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1"), !dbg !750
%22 = bitcast {} addrspace(10)* %_augmented to { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)*, !dbg !752
%tapeld = load { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } addrspace(10)* %22, align 8, !dbg !752, !enzyme_mustcache !4
store { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %tapeld, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }* %tapeld_cache, align 1, !dbg !752, !invariant.group !757
%23 = sub i64 %13, %14, !dbg !752
%24 = add i64 %23, 1, !dbg !758
%25 = icmp ult i64 %23, 9223372036854775807, !dbg !759
%. = select i1 %25, i64 %24, i64 0, !dbg !764
%.fca.0.1.insert = insertvalue [1 x [2 x i64]] [[2 x i64] [i64 1, i64 undef]], i64 %., 0, 1, !dbg !769
br label %L37, !dbg !734
L36: ; preds = %top
%".elt'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1", i64 0, i32 0
%.elt = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 0
%".unpack'ipl" = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %".elt'ipg", align 8
%.unpack = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %.elt, align 8
%.unpack136.unpack.elt = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 0
%.unpack136.unpack.unpack = load i64, i64 addrspace(11)* %.unpack136.unpack.elt, align 8
%26 = insertvalue [2 x i64] undef, i64 %.unpack136.unpack.unpack, 0
%.unpack136.unpack.elt142 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 1, i64 0, i64 1
%.unpack136.unpack.unpack143 = load i64, i64 addrspace(11)* %.unpack136.unpack.elt142, align 8
%.unpack136.unpack144 = insertvalue [2 x i64] %26, i64 %.unpack136.unpack.unpack143, 1
%.unpack136141 = insertvalue [1 x [2 x i64]] undef, [2 x i64] %.unpack136.unpack144, 0
%.elt137 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 2
%.unpack138 = load i64, i64 addrspace(11)* %.elt137, align 8
%.elt139 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, i64 0, i32 3
%.unpack140 = load i64, i64 addrspace(11)* %.elt139, align 8
br label %L37
L37: ; preds = %L36, %L3
%27 = phi {} addrspace(10)* [ %18, %L3 ], [ %".unpack'ipl", %L36 ]
%.pn150 = phi {} addrspace(10)* [ %17, %L3 ], [ %.unpack, %L36 ]
%.fca.0.1.insert.pn = phi [1 x [2 x i64]] [ %.fca.0.1.insert, %L3 ], [ %.unpack136141, %L36 ]
%.pn147 = phi i64 [ 0, %L3 ], [ %.unpack138, %L36 ]
%.pn145 = phi i64 [ 1, %L3 ], [ %.unpack140, %L36 ]
%.fca.0.0.extract117 = extractvalue [1 x [2 x i64]] %.fca.0.1.insert.pn, 0, 0, !dbg !770
%.fca.0.1.extract118 = extractvalue [1 x [2 x i64]] %.fca.0.1.insert.pn, 0, 1, !dbg !770
%28 = sub i64 %.fca.0.1.extract118, %.fca.0.0.extract117, !dbg !776
%29 = add i64 %28, 1, !dbg !780
%30 = icmp sgt i64 %29, 0, !dbg !781
%31 = select i1 %30, i64 %29, i64 0, !dbg !781
%.not132 = icmp eq i64 %31, %.sroa.0126.0.copyload, !dbg !786
br i1 %.not132, label %L56, label %L53, !dbg !774
L53: ; preds = %L37
%32 = getelementptr inbounds [1 x i64], [1 x i64]* %7, i64 0, i64 0, !dbg !774
store i64 %.sroa.0126.0.copyload, i64* %32, align 8, !dbg !774, !tbaa !478
%value_phi1.fca.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 0, !dbg !774
store {} addrspace(10)* %.pn150, {} addrspace(10)** %value_phi1.fca.0.gep, align 8, !dbg !774
%value_phi1.fca.1.0.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 1, i64 0, i64 0, !dbg !774
store i64 %.fca.0.0.extract117, i64* %value_phi1.fca.1.0.0.gep, align 8, !dbg !774
%value_phi1.fca.1.0.1.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 1, i64 0, i64 1, !dbg !774
store i64 %.fca.0.1.extract118, i64* %value_phi1.fca.1.0.1.gep, align 8, !dbg !774
%value_phi1.fca.2.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 2, !dbg !774
store i64 %.pn147, i64* %value_phi1.fca.2.gep, align 8, !dbg !774
%value_phi1.fca.3.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8, i64 0, i32 3, !dbg !774
store i64 %.pn145, i64* %value_phi1.fca.3.gep, align 8, !dbg !774
%33 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %8 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !774
%34 = addrspacecast [1 x i64]* %7 to [1 x i64] addrspace(11)*, !dbg !774
%35 = call fastcc nonnull {} addrspace(10)* @julia_throw_setindex_mismatch_2084({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %33, [1 x i64] addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) %34) #28, !dbg !774
unreachable
L56: ; preds = %L37
%36 = icmp ugt i64 %28, 9223372036854775806, !dbg !787
%37 = icmp slt i64 %.sroa.0126.0.copyload, 1
%or.cond = select i1 %36, i1 true, i1 %37, !dbg !799
store i8 2, i8* %_cache20, align 1, !dbg !799, !invariant.group !800
br i1 %or.cond, label %L218, label %L151.lr.ph, !dbg !799
L122: ; preds = %L197
br i1 %.not133, label %L122.L218.loopexit_crit_edge, label %L151, !dbg !801
L151: ; preds = %L151.lr.ph, %L122
%iv = phi i64 [ 0, %L151.lr.ph ], [ %iv.next, %L122 ]
%value_phi14163 = phi double [ %63, %L151.lr.ph ], [ %value_phi20, %L122 ]
%iv.next = add nuw nsw i64 %iv, 1, !dbg !804
%38 = add nsw i64 %iv.next, -1, !dbg !804
%39 = add i64 %38, %67, !dbg !807
%"'ipg" = getelementptr inbounds double, double addrspace(13)* %"'ipl21", i64 %39, !dbg !807
%40 = getelementptr inbounds double, double addrspace(13)* %69, i64 %39, !dbg !807
store double %value_phi14163, double addrspace(13)* %40, align 8, !dbg !807, !tbaa !188, !alias.scope !808, !noalias !811
%.not133 = icmp eq i64 %iv.next, %29, !dbg !813
%41 = add nuw i64 %iv.next, 1, !dbg !814
br i1 %.not133, label %L197, label %L170, !dbg !817
L170: ; preds = %L151
%42 = icmp ugt i64 %iv.next, 9223372036854775806, !dbg !818
%43 = icmp sgt i64 %41, %.sroa.0126.0.copyload, !dbg !818
%44 = or i1 %42, %43, !dbg !821
br i1 %44, label %L186, label %L189, !dbg !821
L186: ; preds = %L170
store i64 %41, i64* %70, align 8, !dbg !824, !tbaa !478
%value_phi1.fca.0.gep81 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 0, !dbg !821
store {} addrspace(10)* %.pn150, {} addrspace(10)** %value_phi1.fca.0.gep81, align 8, !dbg !821
%value_phi1.fca.1.0.0.gep83 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 1, i64 0, i64 0, !dbg !821
store i64 %.fca.0.0.extract117, i64* %value_phi1.fca.1.0.0.gep83, align 8, !dbg !821
%value_phi1.fca.1.0.1.gep85 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 1, i64 0, i64 1, !dbg !821
store i64 %.fca.0.1.extract118, i64* %value_phi1.fca.1.0.1.gep85, align 8, !dbg !821
%value_phi1.fca.2.gep87 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 2, !dbg !821
store i64 %.pn147, i64* %value_phi1.fca.2.gep87, align 8, !dbg !821
%value_phi1.fca.3.gep89 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6, i64 0, i32 3, !dbg !821
store i64 %.pn145, i64* %value_phi1.fca.3.gep89, align 8, !dbg !821
%45 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %6 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !821
%46 = addrspacecast [1 x i64]* %5 to [1 x i64] addrspace(11)*, !dbg !821
%47 = call fastcc nonnull {} addrspace(10)* @julia_throw_boundserror_2086({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(40) %45, [1 x i64] addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) %46) #28, !dbg !821
unreachable
L189: ; preds = %L170
%48 = add i64 %iv.next, %.pn147, !dbg !825
%"'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc16", align 8, !dbg !825, !tbaa !57, !nonnull !4
%49 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %72, align 8, !dbg !825, !tbaa !57, !nonnull !4
%"'ipg14" = getelementptr inbounds double, double addrspace(13)* %"'ipl", i64 %48, !dbg !825
%50 = getelementptr inbounds double, double addrspace(13)* %49, i64 %48, !dbg !825
%51 = load double, double addrspace(13)* %50, align 8, !dbg !825, !tbaa !188
br label %L197, !dbg !827
L197: ; preds = %L189, %L151
%value_phi20 = phi double [ %51, %L189 ], [ undef, %L151 ]
%.not134 = icmp eq i64 %iv.next, %.sroa.0126.0.copyload, !dbg !829
br i1 %.not134, label %L197.L218.loopexit_crit_edge, label %L122, !dbg !832
L197.L218.loopexit_crit_edge: ; preds = %L197
%52 = phi i64 [ %iv, %L197 ], !dbg !824
store i64 %52, i64* %loopLimit_cache, align 8, !dbg !824, !invariant.group !833
store i64 %41, i64* %70, align 8, !dbg !824, !tbaa !478
store i8 0, i8* %_cache20, align 1, !dbg !832, !invariant.group !800
br label %L218, !dbg !832
L122.L218.loopexit_crit_edge: ; preds = %L122
%53 = phi i64 [ %iv, %L122 ], !dbg !824
store i64 %53, i64* %loopLimit_cache, align 8, !dbg !824, !invariant.group !833
store i64 %41, i64* %70, align 8, !dbg !824, !tbaa !478
store i8 1, i8* %_cache20, align 1, !dbg !801, !invariant.group !800
br label %L218, !dbg !801
L218: ; preds = %L122.L218.loopexit_crit_edge, %L197.L218.loopexit_crit_edge, %L56
%54 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 0, !dbg !834
%55 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %54, align 8, !dbg !834
%56 = getelementptr inbounds [1 x {} addrspace(10)*], [1 x {} addrspace(10)*]* %1, i64 0, i64 0, !dbg !834
store {} addrspace(10)* %55, {} addrspace(10)** %56, align 8, !dbg !834
%57 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %0 to i8*, !dbg !834
%58 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2 to i8 addrspace(11)*, !dbg !834
call void @llvm.memcpy.p0i8.p11i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(40) %57, i8 addrspace(11)* nofree noundef nonnull align 8 dereferenceable(40) %58, i64 noundef 40, i1 noundef false) #27, !dbg !834
br label %invertL218, !dbg !834
L151.lr.ph: ; preds = %L56
%"'ipc24" = bitcast {} addrspace(10)* %27 to double addrspace(13)* addrspace(10)*, !dbg !835
%59 = bitcast {} addrspace(10)* %.pn150 to double addrspace(13)* addrspace(10)*, !dbg !835
%"'ipc25" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc24" to double addrspace(13)* addrspace(11)*, !dbg !835
%60 = addrspacecast double addrspace(13)* addrspace(10)* %59 to double addrspace(13)* addrspace(11)*, !dbg !835
%"'ipl26" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc25", align 8, !dbg !835, !tbaa !57, !nonnull !4
%61 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %60, align 8, !dbg !835, !tbaa !57, !nonnull !4
%"'ipg23" = getelementptr inbounds double, double addrspace(13)* %"'ipl26", i64 %.pn147, !dbg !835
%62 = getelementptr inbounds double, double addrspace(13)* %61, i64 %.pn147, !dbg !835
%63 = load double, double addrspace(13)* %62, align 8, !dbg !835, !tbaa !188
%"'ipc7" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'" to double addrspace(13)* addrspace(10)* addrspace(11)*
%64 = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2 to double addrspace(13)* addrspace(10)* addrspace(11)*
%"'ipl22" = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %"'ipc7" unordered, align 8, !tbaa !44, !nonnull !4, !dereferenceable !48
%65 = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %64 unordered, align 8, !tbaa !44, !invariant.load !4, !nonnull !4, !dereferenceable !48, !align !49
%66 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 2
%67 = load i64, i64 addrspace(11)* %66, align 8, !tbaa !44, !invariant.load !4, !invariant.group !838
%"'ipc" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipl22" to double addrspace(13)* addrspace(11)*
%68 = addrspacecast double addrspace(13)* addrspace(10)* %65 to double addrspace(13)* addrspace(11)*
%"'ipl21" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc", align 16, !tbaa !57, !nonnull !4
%69 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %68, align 16, !tbaa !57, !nonnull !4
%70 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%"'ipc15" = bitcast {} addrspace(10)* %27 to double addrspace(13)* addrspace(10)*
%71 = bitcast {} addrspace(10)* %.pn150 to double addrspace(13)* addrspace(10)*
%"'ipc16" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc15" to double addrspace(13)* addrspace(11)*
%72 = addrspacecast double addrspace(13)* addrspace(10)* %71 to double addrspace(13)* addrspace(11)*
br label %L151, !dbg !801
inverttop: ; preds = %invertL36, %invertL3
ret void
invertL3: ; preds = %invertL37
%73 = load {} addrspace(10)*, {} addrspace(10)** %_cache, align 8, !invariant.group !749
%74 = load {} addrspace(10)*, {} addrspace(10)** %"'mi_cache", align 8, !invariant.group !751
%75 = load { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }, { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 }* %tapeld_cache, align 1, !dbg !752, !invariant.group !757
call fastcc void @diffejulia_copyto__2088({} addrspace(10)* %73, {} addrspace(10)* %74, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %3, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'1", { {} addrspace(10)*, { {} addrspace(10)*, { {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, i64 }, i1, i1, {} addrspace(10)*, i1 }, i1 } %75), !dbg !750
br label %inverttop
invertL36: ; preds = %invertL37
br label %inverttop
invertL37: ; preds = %invertL56
br i1 %.not, label %invertL36, label %invertL3
invertL56: ; preds = %invertL151.lr.ph, %invertL218
br label %invertL37
invertL122: ; preds = %mergeinvertL151_L122.L218.loopexit_crit_edge, %incinvertL151
br label %invertL197
invertL151: ; preds = %invertL197, %invertL170
%76 = load i64, i64* %"iv'ac", align 8
%"'ipc7_unwrap" = bitcast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'" to double addrspace(13)* addrspace(10)* addrspace(11)*
%"'il_phi4_unwrap" = load atomic double addrspace(13)* addrspace(10)*, double addrspace(13)* addrspace(10)* addrspace(11)* %"'ipc7_unwrap" unordered, align 8, !tbaa !44
%"'ipc_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'il_phi4_unwrap" to double addrspace(13)* addrspace(11)*
%"'il_phi5_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc_unwrap", align 16, !tbaa !57
%iv.next_unwrap = add nuw nsw i64 %76, 1
%_unwrap = add nsw i64 %iv.next_unwrap, -1
%_unwrap8 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 2
%_unwrap9 = load i64, i64 addrspace(11)* %_unwrap8, align 8, !tbaa !44, !invariant.group !838
%_unwrap10 = add i64 %_unwrap, %_unwrap9
%"'ipg_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'il_phi5_unwrap", i64 %_unwrap10
%77 = load double, double addrspace(13)* %"'ipg_unwrap", align 8
store double 0.000000e+00, double addrspace(13)* %"'ipg_unwrap", align 8, !dbg !807, !tbaa !188, !alias.scope !811, !noalias !808
%78 = load double, double* %"value_phi14163'de", align 8
%79 = fadd fast double %78, %77
store double %79, double* %"value_phi14163'de", align 8
%80 = load double, double* %"value_phi14163'de", align 8
store double 0.000000e+00, double* %"value_phi14163'de", align 8
%81 = load i64, i64* %"iv'ac", align 8
%82 = icmp eq i64 %81, 0
%83 = xor i1 %82, true
%84 = select fast i1 %82, double %80, double 0.000000e+00
%85 = load double, double* %"'de", align 8
%86 = fadd fast double %85, %80
%87 = select fast i1 %82, double %86, double %85
store double %87, double* %"'de", align 8
%88 = select fast i1 %83, double %80, double 0.000000e+00
%89 = load double, double* %"value_phi20'de", align 8
%90 = fadd fast double %89, %80
%91 = select fast i1 %82, double %89, double %90
store double %91, double* %"value_phi20'de", align 8
br i1 %82, label %invertL151.lr.ph, label %incinvertL151
incinvertL151: ; preds = %invertL151
%92 = load i64, i64* %"iv'ac", align 8
%93 = add nsw i64 %92, -1
store i64 %93, i64* %"iv'ac", align 8
br label %invertL122
invertL170: ; preds = %invertL189
br label %invertL151
invertL189: ; preds = %invertL197
%94 = load double, double* %"'de13", align 8
store double 0.000000e+00, double* %"'de13", align 8
%95 = load i64, i64* %"iv'ac", align 8
%"'ipc15_unwrap" = bitcast {} addrspace(10)* %27 to double addrspace(13)* addrspace(10)*
%"'ipc16_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc15_unwrap" to double addrspace(13)* addrspace(11)*
%"'il_phi_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc16_unwrap", align 8, !dbg !825, !tbaa !57
%iv.next_unwrap17 = add nuw nsw i64 %95, 1
%_unwrap18 = add i64 %iv.next_unwrap17, %.pn147
%"'ipg14_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'il_phi_unwrap", i64 %_unwrap18
%96 = load double, double addrspace(13)* %"'ipg14_unwrap", align 8, !dbg !825, !tbaa !188, !alias.scope !811, !noalias !808
%97 = fadd fast double %96, %94
store double %97, double addrspace(13)* %"'ipg14_unwrap", align 8, !dbg !825, !tbaa !188, !alias.scope !811, !noalias !808
br label %invertL170
invertL197: ; preds = %mergeinvertL151_L197.L218.loopexit_crit_edge, %invertL122
%98 = load double, double* %"value_phi20'de", align 8
store double 0.000000e+00, double* %"value_phi20'de", align 8
%99 = load i64, i64* %"iv'ac", align 8
%iv.next_unwrap19 = add nuw nsw i64 %99, 1
%.not133_unwrap = icmp eq i64 %iv.next_unwrap19, %29
%100 = xor i1 %.not133_unwrap, true
%101 = select fast i1 %100, double %98, double 0.000000e+00
%102 = load double, double* %"'de13", align 8
%103 = fadd fast double %102, %98
%104 = select fast i1 %.not133_unwrap, double %102, double %103
store double %104, double* %"'de13", align 8
br i1 %.not133_unwrap, label %invertL151, label %invertL189
invertL197.L218.loopexit_crit_edge: ; preds = %invertL218
%105 = load i64, i64* %loopLimit_cache, align 8, !invariant.group !833
br label %mergeinvertL151_L197.L218.loopexit_crit_edge
mergeinvertL151_L197.L218.loopexit_crit_edge: ; preds = %invertL197.L218.loopexit_crit_edge
store i64 %105, i64* %"iv'ac", align 8
br label %invertL197
invertL122.L218.loopexit_crit_edge: ; preds = %invertL218
%106 = load i64, i64* %loopLimit_cache, align 8, !invariant.group !833
br label %mergeinvertL151_L122.L218.loopexit_crit_edge
mergeinvertL151_L122.L218.loopexit_crit_edge: ; preds = %invertL122.L218.loopexit_crit_edge
store i64 %106, i64* %"iv'ac", align 8
br label %invertL122
invertL218: ; preds = %L218
%107 = load i8, i8* %_cache20, align 1, !invariant.group !800
switch i8 %107, label %invertL56 [
i8 0, label %invertL197.L218.loopexit_crit_edge
i8 1, label %invertL122.L218.loopexit_crit_edge
]
invertL151.lr.ph: ; preds = %invertL151
%108 = load double, double* %"'de", align 8
store double 0.000000e+00, double* %"'de", align 8
%"'ipc24_unwrap" = bitcast {} addrspace(10)* %27 to double addrspace(13)* addrspace(10)*
%"'ipc25_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc24_unwrap" to double addrspace(13)* addrspace(11)*
%"'il_phi3_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc25_unwrap", align 8, !dbg !835, !tbaa !57
%"'ipg23_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'il_phi3_unwrap", i64 %.pn147
%109 = load double, double addrspace(13)* %"'ipg23_unwrap", align 8, !dbg !835, !tbaa !188, !alias.scope !811, !noalias !808
%110 = fadd fast double %109, %108
store double %110, double addrspace(13)* %"'ipg23_unwrap", align 8, !dbg !835, !tbaa !188, !alias.scope !811, !noalias !808
br label %invertL56
}
; Function Attrs: mustprogress willreturn
define internal void @diffejulia_diffeq_step__2069_inner.1({} addrspace(10)* nonnull align 16 dereferenceable(40) %0) local_unnamed_addr #19 !dbg !604 {
entry:
%1 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%2 = alloca [1 x {} addrspace(10)*], align 8
%"'ipa" = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
store { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } zeroinitializer, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa", align 8
%3 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%"'ipa4" = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
store { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } zeroinitializer, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4", align 8
%4 = alloca { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, align 8
%5 = call {}*** @julia.get_pgcstack() #26
%6 = bitcast {} addrspace(10)* %0 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !608
%7 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %6 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !608
%8 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %7, i64 0, i32 1, !dbg !608
%9 = load i64, i64 addrspace(11)* %8, align 8, !dbg !608, !tbaa !162, !range !164
%.not = icmp eq i64 %9, 2, !dbg !617
br i1 %.not, label %julia_diffeq_step__2069_inner.exit, label %L9.i, !dbg !620
L9.i: ; preds = %entry
%10 = call nonnull {} addrspace(10)* @ijl_box_int64(i64 signext %9) #26, !dbg !621
%11 = call cc38 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* @ijl_invoke to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299984892240 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299955828640 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299476018736 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %10, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299476174216 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140300194545824 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140299476018776 to {}*) to {} addrspace(10)*)) #27, !dbg !621
%current_task1.i22 = getelementptr inbounds {}**, {}*** %5, i64 -12, !dbg !621
%current_task1.i = bitcast {}*** %current_task1.i22 to {}**, !dbg !621
%12 = call noalias nonnull {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1.i, i64 noundef 8, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140299956829248 to {}*) to {} addrspace(10)*)) #28, !dbg !621
%13 = bitcast {} addrspace(10)* %12 to {} addrspace(10)* addrspace(10)*, !dbg !621
store {} addrspace(10)* %11, {} addrspace(10)* addrspace(10)* %13, align 8, !dbg !621, !tbaa !102
%14 = addrspacecast {} addrspace(10)* %12 to {} addrspace(12)*, !dbg !621
call void @ijl_throw({} addrspace(12)* %14) #29, !dbg !621
unreachable
julia_diffeq_step__2069_inner.exit: ; preds = %entry
%".fca.0.gep2'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa", i64 0, i32 0, !dbg !622
%.fca.0.gep2 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 0, !dbg !622
store {} addrspace(10)* %0, {} addrspace(10)** %".fca.0.gep2'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store {} addrspace(10)* %0, {} addrspace(10)** %.fca.0.gep2, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.1.0.0.gep4'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa", i64 0, i32 1, i64 0, i64 0, !dbg !622
%.fca.1.0.0.gep4 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 1, i64 0, i64 0, !dbg !622
store i64 1, i64* %".fca.1.0.0.gep4'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 1, i64* %.fca.1.0.0.gep4, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.1.0.1.gep6'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa", i64 0, i32 1, i64 0, i64 1, !dbg !622
%.fca.1.0.1.gep6 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 1, i64 0, i64 1, !dbg !622
store i64 2, i64* %".fca.1.0.1.gep6'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 2, i64* %.fca.1.0.1.gep6, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.2.gep8'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa", i64 0, i32 2, !dbg !622
%.fca.2.gep8 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 2, !dbg !622
store i64 0, i64* %".fca.2.gep8'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 0, i64* %.fca.2.gep8, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.3.gep10'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa", i64 0, i32 3, !dbg !622
%.fca.3.gep10 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3, i64 0, i32 3, !dbg !622
store i64 1, i64* %".fca.3.gep10'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 1, i64* %.fca.3.gep10, align 8, !dbg !622, !alias.scope !628, !noalias !625
%"'ipc" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !622
%15 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %3 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !622
%".fca.0.gep'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4", i64 0, i32 0, !dbg !622
%.fca.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 0, !dbg !622
store {} addrspace(10)* %0, {} addrspace(10)** %".fca.0.gep'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store {} addrspace(10)* %0, {} addrspace(10)** %.fca.0.gep, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.1.0.0.gep'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4", i64 0, i32 1, i64 0, i64 0, !dbg !622
%.fca.1.0.0.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 1, i64 0, i64 0, !dbg !622
store i64 1, i64* %".fca.1.0.0.gep'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 1, i64* %.fca.1.0.0.gep, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.1.0.1.gep'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4", i64 0, i32 1, i64 0, i64 1, !dbg !622
%.fca.1.0.1.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 1, i64 0, i64 1, !dbg !622
store i64 2, i64* %".fca.1.0.1.gep'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 2, i64* %.fca.1.0.1.gep, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.2.gep'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4", i64 0, i32 2, !dbg !622
%.fca.2.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 2, !dbg !622
store i64 0, i64* %".fca.2.gep'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 0, i64* %.fca.2.gep, align 8, !dbg !622, !alias.scope !628, !noalias !625
%".fca.3.gep'ipg" = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4", i64 0, i32 3, !dbg !622
%.fca.3.gep = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4, i64 0, i32 3, !dbg !622
store i64 1, i64* %".fca.3.gep'ipg", align 8, !dbg !622, !alias.scope !625, !noalias !628
store i64 1, i64* %.fca.3.gep, align 8, !dbg !622, !alias.scope !628, !noalias !625
%"'ipc5" = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %"'ipa4" to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !622
%16 = addrspacecast { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* %4 to { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)*, !dbg !622
br label %invertjulia_diffeq_step__2069_inner.exit, !dbg !630
invertentry: ; preds = %invertjulia_diffeq_step__2069_inner.exit
ret void
invertjulia_diffeq_step__2069_inner.exit: ; preds = %julia_diffeq_step__2069_inner.exit
call fastcc void @diffejulia__unsafe_setindex__2076({ {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }* "enzyme_sret" %1, [1 x {} addrspace(10)*]* %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %15, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'ipc", { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %16, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %"'ipc5", [1 x [1 x i64]] addrspace(11)* undef), !dbg !622
br label %invertentry
}
Thanks for looking into this!
Reducing:
using Enzyme
Enzyme.API.printall!(true)
@noinline function myunaliascopy(V::SubArray{T,N,A,I,LD}) where {T,N,A<:Array,I<:Tuple{Vararg{Union{Real,AbstractRange,Array}}},LD}
dest = Array{T}(undef, Base.index_lengths(V.indices...))
Base.copyto!(dest, V)
SubArray{T,N,A,I,LD}(dest, map(Base._trimmedindex, V.indices), 0, Int(LD))
end
function diffeq_step!(u)
x = @inbounds @view u[1:2]
x′ = Base.unaliascopy(x)
@inbounds Base.setindex!(u, x′[1], 1)
nothing
end
u = rand(2)
diffeq_step!(u)
@show "primal"
Enzyme.autodiff(diffeq_step!, u)
@show "grad"
This seems to be fixed by https://github.com/EnzymeAD/Enzyme/pull/959 which will require a jll bump to be available here.
Thanks Will!