Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom handler for ptr_to_array runtime call #2258

Merged
merged 3 commits into from
Jan 9, 2025
Merged

Conversation

vchuravy
Copy link
Member

@vchuravy vchuravy commented Jan 8, 2025

fixes #2257

@vchuravy vchuravy requested a review from wsmoses January 8, 2025 13:09
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Benchmark Results

main f37271c... main/f37271c46173b8...
basics/overhead 4.33 ± 0.01 ns 4.64 ± 0.01 ns 0.933
time_to_load 1.13 ± 0.007 s 1.13 ± 0.0058 s 1

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@vchuravy
Copy link
Member Author

vchuravy commented Jan 9, 2025

Is the CI failure

Stored value type does not match pointer operand type!
  store {} addrspace(10)* @ejl_jl_nothing, {}** %15, align 8, !noalias !376
 {} addrspace(10)*Stored value type does not match pointer operand type!
  store {} addrspace(10)* @ejl_jl_nothing, {}** %16, align 8, !noalias !376
 {} addrspace(10)*julia: /home/runner/work/Enzyme.jl/Enzyme.jl/julia/src/llvm-remove-addrspaces.cpp:471: llvm::PreservedAnalyses RemoveAddrspacesPass::run(llvm::Module&, llvm::ModuleAnalysisManager&): Assertion `!verifyModule(M, &errs())' failed.

[14414] signal (6.-6): Aborted
in expression starting at /home/runner/work/Enzyme.jl/Enzyme.jl/test/runtests.jl:251
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f571b2ca728)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
run at /home/runner/work/Enzyme.jl/Enzyme.jl/julia/src/llvm-remove-addrspaces.cpp:471
run at /home/runner/work/Enzyme.jl/Enzyme.jl/julia/src/llvm-remove-addrspaces.cpp:514

on 1.10 going to be fixed by 1.10.8?

@wsmoses
Copy link
Member

wsmoses commented Jan 9, 2025

I don't think so, but it would definitely be nice.

I tried to determine what in Julia was going wrong with that to no avail and got distracted by other things

@wsmoses wsmoses merged commit 8a0bff4 into main Jan 9, 2025
21 of 29 checks passed
@wsmoses wsmoses deleted the vc/ptr_to_array branch January 9, 2025 19:47
@vchuravy
Copy link
Member Author

Do we also need to backprop activity?

function InterfaceContainer2D{uEltype}(capacity::Integer, n_variables,
                                       n_nodes) where {uEltype <: Real}
    nan = convert(uEltype, NaN)

    # Initialize fields with defaults
    _u = fill(nan, 2 * n_variables * n_nodes * capacity)
    u = unsafe_wrap(Array, pointer(_u),
                    (2, n_variables, n_nodes, capacity))

    _neighbor_ids = fill(typemin(Int), 2 * capacity)
    neighbor_ids = unsafe_wrap(Array, pointer(_neighbor_ids),
                               (2, capacity))

    orientations = fill(typemin(Int), capacity)

    return InterfaceContainer2D{uEltype}(u, neighbor_ids, orientations,
                                         _u, _neighbor_ids)
end
ERROR: Enzyme could not find shadow for value

 Inverted pointers: 
available inversion for   %290 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %288, i64 2, !dbg !193 of   %"'ipg29" = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %"'ipc28", i64 2, !dbg !230
available inversion for   %memcpy_refined_dst.2.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %55, !dbg !112 of   %"memcpy_refined_dst.2.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %58, !dbg !125
available inversion for   %newstruct48 = call noalias nonnull align 8 dereferenceable(40) "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double, [-1,8,0,-1]:Integer, [-1,16,0,-1]:Integer, [-1,24,0,-1]:Float@double, [-1,32,0,-1]:Integer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 noundef 40, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 131283912876864 to {}*) to {} addrspace(10)*)) #77, !dbg !193 of   %321 = call noalias nonnull align 8 dereferenceable(40) "enzyme_type"="{[-1]:Pointer, [-1,-1]:Pointer, [-1,-1,0]:Pointer, [-1,-1,8]:Integer, [-1,-1,9]:Integer, [-1,-1,10]:Integer, [-1,-1,11]:Integer, [-1,-1,12]:Integer, [-1,-1,13]:Integer, [-1,-1,14]:Integer, [-1,-1,15]:Integer, [-1,-1,16]:Integer, [-1,-1,17]:Integer, [-1,-1,18]:Integer, [-1,-1,19]:Integer, [-1,-1,20]:Integer, [-1,-1,21]:Integer, [-1,-1,22]:Integer, [-1,-1,23]:Integer, [-1,-1,24]:Integer, [-1,-1,25]:Integer, [-1,-1,26]:Integer, [-1,-1,27]:Integer, [-1,-1,28]:Integer, [-1,-1,29]:Integer, [-1,-1,30]:Integer, [-1,-1,31]:Integer, [-1,-1,32]:Integer, [-1,-1,33]:Integer, [-1,-1,34]:Integer, [-1,-1,35]:Integer, [-1,-1,36]:Integer, [-1,-1,37]:Integer, [-1,-1,38]:Integer, [-1,-1,39]:Integer, [-1,0,0,-1]:Float@double, [-1,8,0,-1]:Integer, [-1,16,0,-1]:Integer, [-1,24,0,-1]:Float@double, [-1,32,0,-1]:Integer}" {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task1, i64 noundef 40, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 131283912876864 to {}*) to {} addrspace(10)*)) #77, !dbg !230
available inversion for   %memcpy_refined_dst.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %26, !dbg !112 of   %"memcpy_refined_dst.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %29, !dbg !125
available inversion for   %memcpy_refined_dst.1.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %45, !dbg !112 of   %"memcpy_refined_dst.1.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %48, !dbg !125
available inversion for   %memcpy_refined_dst.2.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %39, !dbg !112 of   %"memcpy_refined_dst.2.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %42, !dbg !125
available inversion for   %memcpy_refined_dst.3.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %56, !dbg !112 of   %"memcpy_refined_dst.3.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %59, !dbg !125
available inversion for   %memcpy_refined_dst.5.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %82, !dbg !112 of   %"memcpy_refined_dst.5.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %85, !dbg !125
available inversion for   %memcpy_refined_dst.3.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %64, !dbg !112 of   %"memcpy_refined_dst.3.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %67, !dbg !125
available inversion for   %memcpy_refined_dst.6.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %93, !dbg !112 of   %"memcpy_refined_dst.6.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %97, !dbg !125
available inversion for   %291 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %288, i64 3, !dbg !193 of   %"'ipg30" = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %"'ipc28", i64 3, !dbg !230
available inversion for   %memcpy_refined_dst.4.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %49, !dbg !112 of   %"memcpy_refined_dst.4.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %52, !dbg !125
available inversion for   %memcpy_refined_dst.2.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %79, !dbg !112 of   %"memcpy_refined_dst.2.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %82, !dbg !125
available inversion for   %memcpy_refined_dst.5.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %50, !dbg !112 of   %"memcpy_refined_dst.5.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %53, !dbg !125
available inversion for   %memcpy_refined_dst.6133 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %70, !dbg !112 of   %"memcpy_refined_dst.6133'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %73, !dbg !125
available inversion for   %memcpy_refined_dst.3.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %80, !dbg !112 of   %"memcpy_refined_dst.3.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %83, !dbg !125
available inversion for   %memcpy_refined_dst.4.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %41, !dbg !112 of   %"memcpy_refined_dst.4.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %44, !dbg !125
available inversion for   %memcpy_refined_dst.5132 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %62, !dbg !112 of   %"memcpy_refined_dst.5132'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %65, !dbg !125
available inversion for   %289 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %288, i64 1, !dbg !193 of   %"'ipg" = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %"'ipc28", i64 1, !dbg !230
available inversion for   %memcpy_refined_dst.3.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %72, !dbg !112 of   %"memcpy_refined_dst.3.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %75, !dbg !125
available inversion for   %99 = call nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {}* @julia.pointer_from_objref({} addrspace(11)* %10) #76, !dbg !133 of   %103 = call {}* @julia.pointer_from_objref({} addrspace(11)* %"'ipc"), !dbg !153
available inversion for   %297 = bitcast i8 addrspace(11)* %296 to {} addrspace(10)* addrspace(11)*, !dbg !193 of   %"'dual_phi18" = phi {} addrspace(10)* addrspace(11)* , !dbg !230
available inversion for   %memcpy_refined_dst.5.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %34, !dbg !112 of   %"memcpy_refined_dst.5.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %37, !dbg !125
available inversion for   %memcpy_refined_dst.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %23, !dbg !112 of   %"memcpy_refined_dst.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %26, !dbg !125
available inversion for   %memcpy_refined_dst.1.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %87, !dbg !112 of   %"memcpy_refined_dst.1.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %91, !dbg !125
available inversion for   %292 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %288, i64 4, !dbg !193 of   %"'ipg31" = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %"'ipc28", i64 4, !dbg !230
available inversion for   %101 = ptrtoint i8* %arrayptr10 to i64, !dbg !133 of   %"'ipc25" = ptrtoint i8* %"arrayptr10'ipl" to i64, !dbg !153
available inversion for   %memcpy_refined_dst.7134 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %78, !dbg !112 of   %"memcpy_refined_dst.7134'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %81, !dbg !125
available inversion for   %103 = call nonnull "enzyme_type"="{[-1]:Pointer}" {} addrspace(10)* @ijl_ptr_to_array({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 131286727865104 to {}*) to {} addrspace(10)*), i64 %101, {} addrspace(10)* noundef nonnull %box, i32 noundef 0) #74, !dbg !139 of   %108 = call {} addrspace(10)* @ijl_ptr_to_array({} addrspace(10)* addrspacecast ({}* inttoptr (i64 131286727865104 to {}*) to {} addrspace(10)*), i64 %"'ipc25", {} addrspace(10)* %box, i32 0), !dbg !160
available inversion for   %memcpy_refined_dst.4.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %65, !dbg !112 of   %"memcpy_refined_dst.4.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %68, !dbg !125
available inversion for   %memcpy_refined_dst.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %27, !dbg !112 of   %"memcpy_refined_dst.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %30, !dbg !125
available inversion for   %10 = addrspacecast {} addrspace(10)* %9 to {} addrspace(11)*, !dbg !78 of   %"'ipc" = addrspacecast {} addrspace(10)* %10 to {} addrspace(11)*, !dbg !88
available inversion for   %294 = getelementptr inbounds i8, i8 addrspace(11)* %293, i64 8, !dbg !193 of   %"'ipg33" = getelementptr inbounds i8, i8 addrspace(11)* %"'ipc32", i64 8, !dbg !230
available inversion for   %memcpy_refined_dst.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %25, !dbg !112 of   %"memcpy_refined_dst.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %28, !dbg !125
available inversion for   %memcpy_refined_dst.5.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %58, !dbg !112 of   %"memcpy_refined_dst.5.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %61, !dbg !125
available inversion for   %memcpy_refined_dst.4.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %33, !dbg !112 of   %"memcpy_refined_dst.4.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %36, !dbg !125
available inversion for   %100 = bitcast {}* %99 to i8**, !dbg !133 of   %"'ipc24" = bitcast {}* %103 to i8**, !dbg !153
available inversion for   %memcpy_refined_dst.2.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %31, !dbg !112 of   %"memcpy_refined_dst.2.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %34, !dbg !125
available inversion for   %12 = addrspacecast {} addrspace(10)* %9 to double addrspace(13)* addrspace(11)*, !dbg !112 of   %"'ipc23" = addrspacecast {} addrspace(10)* %10 to double addrspace(13)* addrspace(11)*, !dbg !125
available inversion for   %memcpy_refined_dst.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %24, !dbg !112 of   %"memcpy_refined_dst.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %27, !dbg !125
available inversion for   %memcpy_refined_dst.2.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %71, !dbg !112 of   %"memcpy_refined_dst.2.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %74, !dbg !125
available inversion for   %memcpy_refined_dst.1.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %77, !dbg !112 of   %"memcpy_refined_dst.1.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %80, !dbg !125
available inversion for   %9 = call noalias nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 131286517048880 to {}*) to {} addrspace(10)*), i64 %8) #75, !dbg !70 of   %10 = call noalias nonnull "enzyme_type"="{[-1]:Pointer, [-1,0]:Pointer, [-1,0,-1]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer}" {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 131286517048880 to {}*) to {} addrspace(10)*), i64 %8) #75, !dbg !80
available inversion for   %memcpy_refined_dst.3.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %90, !dbg !112 of   %"memcpy_refined_dst.3.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %94, !dbg !125
available inversion for   %296 = getelementptr inbounds i8, i8 addrspace(11)* %293, i64 16, !dbg !193 of   %"'dual_phi17" = phi i8 addrspace(11)* , !dbg !230
available inversion for   %memcpy_refined_dst.5.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %92, !dbg !112 of   %"memcpy_refined_dst.5.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %96, !dbg !125
available inversion for   %memcpy_refined_dst.7.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %60, !dbg !112 of   %"memcpy_refined_dst.7.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %63, !dbg !125
available inversion for   %299 = bitcast i8 addrspace(11)* %298 to {} addrspace(10)* addrspace(11)*, !dbg !193 of   %"'dual_phi20" = phi {} addrspace(10)* addrspace(11)* , !dbg !230
available inversion for   %memcpy_refined_dst.1.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %69, !dbg !112 of   %"memcpy_refined_dst.1.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %72, !dbg !125
available inversion for   %298 = getelementptr inbounds i8, i8 addrspace(11)* %293, i64 24, !dbg !193 of   %"'dual_phi19" = phi i8 addrspace(11)* , !dbg !230
available inversion for   %memcpy_refined_dst.7.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %52, !dbg !112 of   %"memcpy_refined_dst.7.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %55, !dbg !125
available inversion for   %memcpy_refined_dst.5.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %42, !dbg !112 of   %"memcpy_refined_dst.5.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %45, !dbg !125
available inversion for   %memcpy_refined_dst.1.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %53, !dbg !112 of   %"memcpy_refined_dst.1.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %56, !dbg !125
available inversion for   %memcpy_refined_dst.4.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %91, !dbg !112 of   %"memcpy_refined_dst.4.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %95, !dbg !125
available inversion for   %301 = bitcast i8 addrspace(11)* %300 to {} addrspace(10)* addrspace(11)*, !dbg !193 of   %"'dual_phi22" = phi {} addrspace(10)* addrspace(11)* , !dbg !230
available inversion for   %memcpy_refined_dst.1.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %61, !dbg !112 of   %"memcpy_refined_dst.1.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %64, !dbg !125
available inversion for   %memcpy_refined_dst.2129 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %38, !dbg !112 of   %"memcpy_refined_dst.2129'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %41, !dbg !125
available inversion for   %memcpy_refined_dst.3.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %48, !dbg !112 of   %"memcpy_refined_dst.3.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %51, !dbg !125
available inversion for   %memcpy_refined_dst.5.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %74, !dbg !112 of   %"memcpy_refined_dst.5.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %77, !dbg !125
available inversion for   %memcpy_refined_dst.6.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %59, !dbg !112 of   %"memcpy_refined_dst.6.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %62, !dbg !125
available inversion for   %memcpy_refined_dst.3.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %40, !dbg !112 of   %"memcpy_refined_dst.3.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %43, !dbg !125
available inversion for   %memcpy_refined_dst.7.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %68, !dbg !112 of   %"memcpy_refined_dst.7.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %71, !dbg !125
available inversion for   %memcpy_refined_dst.4.4 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %57, !dbg !112 of   %"memcpy_refined_dst.4.4'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %60, !dbg !125
available inversion for   %300 = getelementptr inbounds i8, i8 addrspace(11)* %293, i64 32, !dbg !193 of   %"'dual_phi21" = phi i8 addrspace(11)* , !dbg !230
available inversion for   %memcpy_refined_dst.2.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %47, !dbg !112 of   %"memcpy_refined_dst.2.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %50, !dbg !125
available inversion for   %295 = bitcast i8 addrspace(11)* %294 to {} addrspace(10)* addrspace(11)*, !dbg !193 of   %"'ipc34" = bitcast i8 addrspace(11)* %"'ipg33" to {} addrspace(10)* addrspace(11)*, !dbg !230
available inversion for   %memcpy_refined_dst.6.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %43, !dbg !112 of   %"memcpy_refined_dst.6.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %46, !dbg !125
available inversion for   %memcpy_refined_dst.7.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %84, !dbg !112 of   %"memcpy_refined_dst.7.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %87, !dbg !125
available inversion for   %memcpy_refined_dst.3130 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %46, !dbg !112 of   %"memcpy_refined_dst.3130'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %49, !dbg !125
available inversion for   %memcpy_refined_dst.epil121 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %88, !dbg !112 of   %"memcpy_refined_dst.epil121'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %92, !dbg !125
available inversion for   %memcpy_refined_dst.1.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %29, !dbg !112 of   %"memcpy_refined_dst.1.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %32, !dbg !125
available inversion for   %memcpy_refined_dst.6.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %75, !dbg !112 of   %"memcpy_refined_dst.6.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %78, !dbg !125
available inversion for   %memcpy_refined_dst.4131 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %54, !dbg !112 of   %"memcpy_refined_dst.4131'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %57, !dbg !125
available inversion for   %memcpy_refined_dst.2.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %89, !dbg !112 of   %"memcpy_refined_dst.2.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %93, !dbg !125
available inversion for   %memcpy_refined_dst.1128 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %30, !dbg !112 of   %"memcpy_refined_dst.1128'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %33, !dbg !125
available inversion for   %memcpy_refined_dst.7.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %76, !dbg !112 of   %"memcpy_refined_dst.7.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %79, !dbg !125
available inversion for   %memcpy_refined_dst.6.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %67, !dbg !112 of   %"memcpy_refined_dst.6.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %70, !dbg !125
available inversion for   %memcpy_refined_dst.7.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %44, !dbg !112 of   %"memcpy_refined_dst.7.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %47, !dbg !125
available inversion for   %memcpy_refined_dst.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %21, !dbg !112 of   %"memcpy_refined_dst.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %24, !dbg !125
available inversion for   %memcpy_refined_dst.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %28, !dbg !112 of   %"memcpy_refined_dst.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %31, !dbg !125
available inversion for   %memcpy_refined_dst.4.6 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %73, !dbg !112 of   %"memcpy_refined_dst.4.6'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %76, !dbg !125
available inversion for   %arrayptr.pre58 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %12, align 8, !dbg !112, !tbaa !115, !alias.scope !117, !noalias !96, !enzyme_type !120, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0 of   %"arrayptr.pre58'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc23", align 8, !dbg !125, !tbaa !128, !alias.scope !130, !noalias !133
available inversion for   %memcpy_refined_dst.7.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %94, !dbg !112 of   %"memcpy_refined_dst.7.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %98, !dbg !125
available inversion for   %293 = addrspacecast {} addrspace(10)* %newstruct48 to i8 addrspace(11)*, !dbg !193 of   %"'ipc32" = addrspacecast {} addrspace(10)* %321 to i8 addrspace(11)*, !dbg !230
available inversion for   %memcpy_refined_dst.4.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %81, !dbg !112 of   %"memcpy_refined_dst.4.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %84, !dbg !125
available inversion for   %288 = addrspacecast {} addrspace(10)* %newstruct48 to {} addrspace(10)* addrspace(11)*, !dbg !193 of   %"'ipc28" = addrspacecast {} addrspace(10)* %321 to {} addrspace(10)* addrspace(11)*, !dbg !230
available inversion for   %memcpy_refined_dst.6.3 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %51, !dbg !112 of   %"memcpy_refined_dst.6.3'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %54, !dbg !125
available inversion for   %memcpy_refined_dst.6.7 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %83, !dbg !112 of   %"memcpy_refined_dst.6.7'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %86, !dbg !125
available inversion for   %arrayptr10 = load i8*, i8** %100, align 8, !dbg !133, !tbaa !115, !alias.scope !93, !noalias !96, !nonnull !0, !enzyme_type !120, !enzymejl_byref_BITS_VALUE !0, !enzymejl_source_type_Ptr\7BFloat64\7D !0 of   %"arrayptr10'ipl" = load i8*, i8** %"'ipc24", align 8, !dbg !153, !tbaa !128, !alias.scope !159, !noalias !133, !nonnull !0
available inversion for   %memcpy_refined_dst.1.2 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %37, !dbg !112 of   %"memcpy_refined_dst.1.2'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %40, !dbg !125
available inversion for   %memcpy_refined_dst.2.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %63, !dbg !112 of   %"memcpy_refined_dst.2.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %66, !dbg !125
available inversion for   %memcpy_refined_dst.3.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %32, !dbg !112 of   %"memcpy_refined_dst.3.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %35, !dbg !125
available inversion for   %memcpy_refined_dst.5.5 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %66, !dbg !112 of   %"memcpy_refined_dst.5.5'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %69, !dbg !125
available inversion for   %memcpy_refined_dst.6.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %35, !dbg !112 of   %"memcpy_refined_dst.6.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %38, !dbg !125
available inversion for   %memcpy_refined_dst.epil = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %97, !dbg !112 of   %"memcpy_refined_dst.epil'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %102, !dbg !125
available inversion for   %memcpy_refined_dst.7.1 = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %36, !dbg !112 of   %"memcpy_refined_dst.7.1'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %39, !dbg !125
available inversion for   %memcpy_refined_dst = getelementptr inbounds double, double addrspace(13)* %arrayptr.pre58, i64 %22, !dbg !112 of   %"memcpy_refined_dst'ipg" = getelementptr inbounds double, double addrspace(13)* %"arrayptr.pre58'ipl", i64 %25, !dbg !125

cannot find shadow for   %198 = call nonnull "enzyme_type"="{[-1]:Pointer}" {} addrspace(10)* @ijl_ptr_to_array({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 131286516700880 to {}*) to {} addrspace(10)*), i64 %196, {} addrspace(10)* noundef nonnull %box32, i32 noundef 0) #74, !dbg !171

Caused by:
Stacktrace:
 [1] #unsafe_wrap#105
   @ ./pointer.jl:87
 [2] unsafe_wrap
   @ ./pointer.jl:85
 [3] InterfaceContainer2D
   @ ~/src/Trixi/src/solvers/dgsem_tree/containers_2d.jl:187


Stacktrace:
  [1] InterfaceContainer2D
    @ ~/src/Trixi/src/solvers/dgsem_tree/containers_2d.jl:146 [inlined]
  [2] InterfaceContainer2D
    @ ~/src/Trixi/src/solvers/dgsem_tree/containers_2d.jl:192
  [3] init_interfaces
    @ ~/src/Trixi/src/solvers/dgsem_tree/containers_2d.jl:204 [inlined]
  [4] create_cache
    @ ~/src/Trixi/src/solvers/dgsem_tree/dg_2d.jl:21 [inlined]
  [5] create_cache
    @ ~/src/Trixi/src/solvers/dgsem_tree/dg_2d.jl:0 [inlined]
  [6] fwddiffejulia_create_cache_7812_inner_1wrap
    @ ~/src/Trixi/src/solvers/dgsem_tree/dg_2d.jl:0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing derivative rule for ptr_to_array & co.
2 participants