You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
double dprod(const std::vector& v) {
double r = 1;
for (int i = 0; i < v.size(); i++) {
r *= v[i];
}
return r;
}
double g2(double x, int n) {
std::vector v;
for (int i = 0; i < n; ++i) {
v.push_back(std::pow(x, i));
}
return dprod(v);
}
int main() {
double x = 3;
int n = 5;
double dg2_dx = __enzyme_autodiff((void*)g2, enzyme_out, x, enzyme_const, n);
printf("g2(%g, %d)=%g, dg2_dx=%g\n", x, n, g2(x,n), dg2_dx);
}
It works fine when built with clang18 with "-O3 -std=c++20", but it failed with clang20 with the same build/compilation options, here is the error message,
Here is the code,
double dprod(const std::vector& v) {
double r = 1;
for (int i = 0; i < v.size(); i++) {
r *= v[i];
}
return r;
}
double g2(double x, int n) {
std::vector v;
for (int i = 0; i < n; ++i) {
v.push_back(std::pow(x, i));
}
return dprod(v);
}
int main() {
double x = 3;
int n = 5;
double dg2_dx = __enzyme_autodiff((void*)g2, enzyme_out, x, enzyme_const, n);
printf("g2(%g, %d)=%g, dg2_dx=%g\n", x, n, g2(x,n), dg2_dx);
}
It works fine when built with clang18 with "-O3 -std=c++20", but it failed with clang20 with the same build/compilation options, here is the error message,
unknown tbaa call instruction user inst: %call.i = tail call noundef double @pow(double noundef %x, double noundef %conv.i) #12, !dbg !2031, !tbaa !2032 vdptr: {[]:Pointer, [-1]:Integer}
unknown tbaa call instruction user inst: %call.i = tail call noundef double @pow(double noundef %x, double noundef %conv.i) #13, !dbg !2030, !tbaa !2031 vdptr: {[]:Pointer, [-1]:Integer}
clang++: /root/llvm-project/llvm/lib/IR/Instruction.cpp:153: void llvm::Instruction::insertBefore(llvm::BasicBlock&, llvm::iplist_impl<llvm::simple_ilist<llvm::Instruction, llvm::ilist_iterator_bits, llvm::ilist_parentllvm::BasicBlock >, llvm::SymbolTableListTraits<llvm::Instruction, llvm::ilist_iterator_bits, llvm::ilist_parentllvm::BasicBlock > >::iterator): Assertion `!isa(this) && "Inserting PHI after debug-records!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /tmp/compiler-explorer-compiler2024928-67-1ef00sm.0vvil/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S -fpass-plugin=/opt/compiler-explorer/main/ClangEnzyme-20.so -Xclang -load -Xclang /opt/compiler-explorer/main/ClangEnzyme-20.so -fcolor-diagnostics -fno-crash-diagnostics -O3 -std=c++20
The text was updated successfully, but these errors were encountered: