Closed akdemironur closed 1 year ago
define void @foo(double* nocapture %0) {
%2 = bitcast double* %0 to i8*
tail call void @llvm.memset.p0i8.i64(i8* nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
ret void
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1)
; Function Attrs: nounwind uwtable
define void @caller(double* %0, double* %1) {
tail call void (...) @__enzyme_autodiff(void (double*)* @foo, metadata !"enzyme_dupnoneed", double* %0, double* %1)
ret void
}
declare void @__enzyme_autodiff(...)
I'm getting an error after 5905cd6, here are my findings:
Consider the following code:
Compiling it after the commit 5905cd6 gives following output (I've written workarounds end of this issue):
Any release before that commit gives following output as expected(of course with warnings):
An easy fix I'm using is basically deleting initial assignment, following code compiles fine with newer releases too:
Another user fix is don't using
enzyme_dupnoneed
:(Also, as I see this problem only occurs with structs with more than 1 variable)