Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/codegen-llvm/autodiff/abi_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn f1(x: &[f32; 2]) -> f32 {
// CHECK-NEXT: Function Attrs
// debug-NEXT: define internal { float, float }
// debug-SAME: (ptr %f, float %x, float %dret)
// release-NEXT: define internal fastcc noundef float
// release-NEXT: define internal fastcc float
// release-SAME: (float noundef %x)

// CHECK-LABEL: ; abi_handling::f2
Expand All @@ -77,7 +77,7 @@ fn f2(f: fn(f32) -> f32, x: f32) -> f32 {
// CHECK-NEXT: Function Attrs
// debug-NEXT: define internal { float, float }
// debug-SAME: (ptr align 4 %x, ptr align 4 %bx_0, ptr align 4 %y, ptr align 4 %by_0)
// release-NEXT: define internal fastcc float
// release-NEXT: define internal fastcc { float, float }

@Sa4dUs Sa4dUs Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks weird to me but i've been a bit disconnected from autodiff lately so dunno if it's expected

View changes since the review

// release-SAME: (float %x.0.val)

// CHECK-LABEL: ; abi_handling::f3
Expand Down
15 changes: 9 additions & 6 deletions tests/codegen-llvm/autodiff/batched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ fn square(x: &f32) -> f32 {
}

// The base ("scalar") case d_square3, without batching.
// CHECK: define internal fastcc float @fwddiffesquare(float %x.0.val, float %"x'.0.val")
// CHECK: %0 = fadd fast float %"x'.0.val", %"x'.0.val"
// CHECK-NEXT: %1 = fmul fast float %0, %x.0.val
// CHECK-NEXT: ret float %1
// CHECK: define internal float @fwddiffesquare(ptr {{.*}} %x, ptr {{.*}} %"x'")
// CHECK: %"_2'ipl" = load float, ptr %"x'", align 4
// CHECK-NEXT: %_2 = load float, ptr %x, align 4
// CHECK-NEXT: %0 = fmul fast float %"_2'ipl", %_2
// CHECK-NEXT: %1 = fmul fast float %"_2'ipl", %_2
// CHECK-NEXT: %2 = fadd fast float %0, %1
// CHECK-NEXT: ret float %2
// CHECK-NEXT: }

// d_square2
// CHECK: define internal fastcc [4 x float] @fwddiffe4square(float %x.0.val, [4 x ptr] %"x'")
// CHECK: define internal [4 x float] @fwddiffe4square(ptr {{.*}} %x, [4 x ptr] %"x'")
// CHECK: ret [4 x float]
// CHECK-NEXT: }

// CHECK: define internal fastcc { float, [4 x float] } @fwddiffe4square.{{.*}}(float %x.0.val, [4 x ptr] %"x'")
// CHECK: define internal { float, [4 x float] } @fwddiffe4square.{{.*}}(ptr {{.*}} %x, [4 x ptr] %"x'")
// CHECK: ret { float, [4 x float] }
// CHECK-NEXT: }

Expand Down
3 changes: 2 additions & 1 deletion tests/codegen-llvm/autodiff/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ fn square<T: std::ops::Mul<Output = T> + Copy>(x: &T) -> T {
// F64-NEXT: ; Function Attrs: {{.*}}
// F64-NEXT: define internal {{.*}} void
// F64-NEXT: start:
// F64-NEXT: {{(tail )?}}call {{(fastcc )?}}void @diffe_{{.*}}(double {{.*}}, ptr {{.*}})
// F64-NEXT: {{(tail )?}}call {{(fast )?}}{ double } @diffe_{{.*}}(ptr {{.*}}, ptr {{.*}}, double {{.*}})
// F64-NEXT: %1 = extractvalue { double } %0, 0
// F64-NEXT: ret void

// Main-LABEL: ; generic::main
Expand Down
Loading