Skip to content

Derived cache issue #2554

@wsmoses

Description

@wsmoses
define ptr addrspace(10) @retv(double %arg, ptr addrspace(10) %arg1) {
bb:
  ret ptr addrspace(10) %arg1
}

; Function Attrs: nofree norecurse nosync nounwind speculatable willreturn memory(argmem: read)
declare noundef nonnull ptr addrspace(13) @julia.gc_loaded(ptr addrspace(10) nocapture noundef nonnull readnone, ptr noundef nonnull readnone) local_unnamed_addr #1

define  double @ifn(ptr addrspace(11) %arg, ptr addrspace(10) %arg1) {
bb:
  %i7 = load ptr addrspace(10), ptr addrspace(11) %arg, align 8
  %i8 = addrspacecast ptr addrspace(10) %i7 to ptr addrspace(11)
  %i31 = load ptr, ptr addrspace(11) %i8, align 8, !enzyme_nocache !14
  
  %i32 = getelementptr inbounds { ptr, ptr addrspace(10) }, ptr addrspace(11) %i8, i64 0, i32 1
  %i33 = load ptr addrspace(10), ptr addrspace(11) %i32, align 8
  
  %i50 = call ptr addrspace(13) @julia.gc_loaded(ptr addrspace(10) noundef %i33, ptr noundef %i31)
  
  %i51 = load double, ptr addrspace(13) %i50, align 8
  
  %i52 = call ptr addrspace(10) @retv(double %i51, ptr addrspace(10) %arg1)

  ret double %i51
}

declare void @__enzyme_autodiff(...)

define void @dsquare(double %arg) {
bb:
  tail call void (...) @__enzyme_autodiff(ptr @ifn, metadata !"enzyme_runtime_activity", metadata !"enzyme_dup", ptr addrspace(11) undef, ptr addrspace(11) undef, metadata !"enzyme_dup", ptr addrspace(10) undef, ptr addrspace(10) undef)
  ret void
}

attributes #1 = { nofree norecurse nosync nounwind speculatable willreturn memory(argmem: read) "enzyme_nocache" "enzyme_shouldrecompute" "enzymejl_world"="26726" }

!14 = !{}

https://fwd.gymni.ch/w8PrhG

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions