EnzymeAD / Enzyme

High-performance automatic differentiation of LLVM and MLIR.

Home Page:https://enzyme.mit.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken InsertVector diffuse analysis

wsmoses opened this issue · comments

define { double, i64 } @julia_logabsgamma_3264_inner.1(double %x, i64 %z) {
entry:
  %iadd = add i64 %z, 1
  %.fca.0.insert = insertvalue { double, i64 } undef, double %x, 0
  %.fca.1.insert = insertvalue { double, i64 } %.fca.0.insert, i64 %iadd, 1
  ret { double, i64 } %.fca.1.insert
}

declare { double, i64 } @__enzyme_fwddiff(...)

define { double, i64 } @ad(double %x, double %dx) {
  %m = call  { double, i64 } (...) @__enzyme_fwddiff({ double, i64 } (double, i64)* @julia_logabsgamma_3264_inner.1, double %x, double %dx, i64 1)
  ret { double, i64 } %m
}

https://fwd.gymni.ch/9STXCf

Fixed by #1661