Skip to content

Commit e30d9d7

Browse files
committed
Remove unhelpful @compute test case
The @compute function doesn't meaningfully test the LLVM-type seeding fallback because float types are already assumed to be the correct float by default. Keeping only the @ad_compute end-to-end test which exercises the fix in the context it was designed for: preventing "Cannot deduce type of extract" errors when loose-types is enabled.
1 parent 487f7c2 commit e30d9d7

1 file changed

Lines changed: 2 additions & 30 deletions

File tree

enzyme/test/TypeAnalysis/extractvalue_aggregate.ll

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
; RUN: if [ %llvmver -lt 16 ]; then %opt < %s %loadEnzyme -print-type-analysis -type-analysis-func=compute -enzyme-loose-types -enzyme-type-warning=0 -o /dev/null | FileCheck %s; fi
2-
; RUN: %opt < %s %newLoadEnzyme -passes="print-type-analysis" -type-analysis-func=compute -enzyme-loose-types -enzyme-type-warning=0 -S -o /dev/null | FileCheck %s
3-
41
; End-to-end check: with loose-types, the full enzyme pass succeeds (no
52
; "Cannot deduce type of extract" diagnostic) and emits a reverse-mode
63
; entry point. Pre-fix this run failed because the extracted [2 x float]
@@ -13,12 +10,11 @@
1310
; extractvalue result is..." warning must be emitted (gated on the
1411
; default-on -enzyme-type-warning) so users can see when this potentially
1512
; lossy assumption is being made.
16-
; RUN: %opt < %s %newLoadEnzyme -passes="print-type-analysis" -type-analysis-func=compute -enzyme-loose-types -S -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN
13+
; RUN: %opt < %s %newLoadEnzyme -passes="print-type-analysis" -type-analysis-func=ad_compute -enzyme-loose-types -S -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN
1714

1815
; Regression test for EnzymeAD/Enzyme#2630 (and #2463): with looseTypeAnalysis,
1916
; TypeAnalysis seeds float type info for extractvalue results whose source
20-
; aggregate comes from an opaque external call. The function takes i64 (not
21-
; float) so the only source of float info is the extractvalue LLVM type seeding.
17+
; aggregate comes from an opaque external call.
2218

2319
target triple = "x86_64-unknown-linux-gnu"
2420

@@ -30,18 +26,6 @@ declare float @__enzyme_autodiff(...)
3026

3127
attributes #0 = { "enzyme_inactive" }
3228

33-
define void @compute(i64 %opaque) {
34-
entry:
35-
%r = call %struct.CV @pre_work(i64 %opaque)
36-
%a = extractvalue %struct.CV %r, 0
37-
%b = extractvalue %struct.CV %r, 1
38-
%a0 = extractvalue [2 x float] %a, 0
39-
%a1 = extractvalue [2 x float] %a, 1
40-
%b0 = extractvalue [2 x [3 x float]] %b, 0, 0
41-
%b1 = extractvalue [2 x [3 x float]] %b, 1, 2
42-
ret void
43-
}
44-
4529
; Active reverse-mode entry. Mirrors #2630's pattern: an opaque struct
4630
; return whose elements feed an active fmul. Without the fix the enzyme
4731
; pass aborts with "Cannot deduce type of extract" on the [2 x float]
@@ -65,18 +49,6 @@ define float @caller(float %seed) {
6549
ret float %d
6650
}
6751

68-
; CHECK: compute - {} |{[-1]:Integer}:{}
69-
; CHECK-NEXT: i64 %opaque: {[-1]:Integer}
70-
; CHECK-NEXT: entry
71-
; CHECK-NEXT: %r = call %struct.CV @pre_work(i64 %opaque): {[0]:Float@float, [4]:Float@float, [8]:Float@float, [12]:Float@float, [16]:Float@float, [20]:Float@float, [24]:Float@float, [28]:Float@float}
72-
; CHECK-NEXT: %a = extractvalue %struct.CV %r, 0: {[-1]:Float@float}
73-
; CHECK-NEXT: %b = extractvalue %struct.CV %r, 1: {[-1]:Float@float}
74-
; CHECK-NEXT: %a0 = extractvalue [2 x float] %a, 0: {[-1]:Float@float}
75-
; CHECK-NEXT: %a1 = extractvalue [2 x float] %a, 1: {[-1]:Float@float}
76-
; CHECK-NEXT: %b0 = extractvalue [2 x [3 x float]] %b, 0, 0: {[-1]:Float@float}
77-
; CHECK-NEXT: %b1 = extractvalue [2 x [3 x float]] %b, 1, 2: {[-1]:Float@float}
78-
; CHECK-NEXT: ret void: {}
79-
8052
; ENZYME: define internal {{.*}} @diffead_compute
8153
; ENZYME-NOT: Cannot deduce type of extract
8254

0 commit comments

Comments
 (0)