From 41e7e565eb3dfa13562cbfa3e8641874c2c6d66c Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:12:27 -0400 Subject: Add a loop analysis step to infer the exit values of loop phi parameters. (#6696) * Initial loop analysis pass * More changes for a single-pass implication propagation * Update slang-ir-autodiff-loop-analysis.cpp * Cleanup + new system for loop analysis * Fixup bugs in loop analysis * Remove some relation types to simplify the analysis. Add test * Remove unused * Address comments * Fix issue with continue loops * Update reverse-loop-exit-value-inference-1.slang * Update reverse-continue-loop.slang --- tests/autodiff/reverse-loop-diff-only-2.slang | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tests/autodiff/reverse-loop-diff-only-2.slang') diff --git a/tests/autodiff/reverse-loop-diff-only-2.slang b/tests/autodiff/reverse-loop-diff-only-2.slang index 2cc33ecca..cc9e14736 100644 --- a/tests/autodiff/reverse-loop-diff-only-2.slang +++ b/tests/autodiff/reverse-loop-diff-only-2.slang @@ -32,10 +32,17 @@ float infinitesimal(float x) // Test that computeLoop's intermediates have no float sitting // around (must not cache the outvar from 'compute()') -// CHECK: struct s_bwd_prop_computeLoop_Intermediates -// CHECK-NEXT: { -// CHECK-NOT: {{[A-Za-z0-9_]+}} {{[A-Za-z0-9_]+}}[{{.*}}] -// CHECK: } +// +// Further, if loop exit value inference is working correctly, +// then there should be no context type at all. +// +// CHECK-NOT: struct s_bwd_prop_computeLoop_Intermediates +// +// Check that the signature of the s_bwd_prop_computeLoop function only +// contains an inout DiffPair_float_0 and a float. +// +// CHECK: void s_bwd_prop_computeLoop{{[_0-9]*}}(inout DiffPair_float{{[_0-9]*}} dpy{{[_0-9]*}}, float {{[_a-zA-Z0-9]*}}) +// [BackwardDifferentiable] [PreferRecompute] -- cgit v1.2.3