EnzymeAD / EnzymeAD/Enzyme

function failed verification

Open
#3,028 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
LLVM
Stars
1.7k
Forks
188
Avg merge
1d 22h
Merged PRs (30d)
26

Description

https://tinyurl.com/288cgvjd

```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@enzyme_primal_return = external global ptr
@enzyme_dup = external global ptr

define i32 @eig_step(ptr %0, i1 %1) {
%3 = load i32, ptr %0, align 4
br label %4

4: ; preds = %8, %2
%5 = phi i32 [ %9, %8 ], [ %3, %2 ]
%6 = phi i32 [ %.mux, %8 ], [ 0, %2 ]
%.mux = select i1 false, i32 %6, i32 %5
br i1 %1, label %8, label %7

7: ; preds = %4
call fastcc void @sink(i32 %6)
ret i32 0

8: ; preds = %4
%9 = add i32 %5, 1
br label %4
}

define fastcc void @sink(i32 %0) {
store double 0.000000e+00, ptr null, align 8
ret void
}

define double @entry() {
%1 = tail call double (...) @__enzyme_autodiff_dwrap(ptr @wrap, ptr @enzyme_primal_return, ptr @enzyme_dup, ptr null, ptr null, ptr @enzyme_dup, ptr null, ptr null, ptr @enzyme_dup, ptr null, ptr null, ptr @enzyme_dup, ptr null, ptr null)
ret double %1
}

define double @wrap(ptr %0, ptr %1, ptr %2, ptr %3) {
%5 = call i32 @eig_step(ptr %0, i1 false)
%6 = load double, ptr %0, align 8
%7 = fmul double %6, %6
ret double %7
}

declare double @__enzyme_autodiff_dwrap(...)
```
another minimized one @wsmoses . There are a couple of other assertions I triggered but minimization tends to quickly run into one of the 3 open ones. So I'll give it another round once some of the open ones are fixed.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the minimized LLVM IR in the issue and follow the linked report for the exact verification assertion. Compare the behavior with the other open assertions mentioned in the report; done means this reproducer no longer triggers the verification failure.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.