diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-07-19 03:04:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-19 00:04:12 -0700 |
| commit | 335c1a2d0013091e8ecc1691b3521cf22fed3c6c (patch) | |
| tree | 24b15fe38f3b8795d6065eef526998f55a362486 /source | |
| parent | a00d603519d395d41b2f68c5874e8a708335a31a (diff) | |
move autodiff-decoration-stripping-pass so it always runs (#4632)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit.cpp | 5 | ||||
| -rw-r--r-- | source/slang/slang-ir-autodiff.cpp | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index b690b7c38..417bbf200 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -292,7 +292,6 @@ void calcRequiredLoweringPassSet(RequiredLoweringPassSet& result, CodeGenContext case kIROp_BackwardDifferentiate: case kIROp_ForwardDifferentiate: case kIROp_MakeDifferentialPairUserCode: - case kIROp_DerivativeMemberDecoration: result.autodiff = true; break; case kIROp_VerticesType: @@ -709,6 +708,10 @@ Result linkAndOptimizeIR( if (requiredLoweringPassSet.autodiff) finalizeAutoDiffPass(targetProgram, irModule); + // Remove auto-diff related decorations. + // We may have an autodiff decoration regardless of if autodiff is being used. + stripAutoDiffDecorations(irModule); + finalizeSpecialization(irModule); requiredLoweringPassSet = {}; diff --git a/source/slang/slang-ir-autodiff.cpp b/source/slang/slang-ir-autodiff.cpp index 14b53c0e0..6b275179c 100644 --- a/source/slang/slang-ir-autodiff.cpp +++ b/source/slang/slang-ir-autodiff.cpp @@ -2072,9 +2072,6 @@ bool finalizeAutoDiffPass(TargetProgram* target, IRModule* module) stripNoDiffTypeAttribute(module); - // Remove auto-diff related decorations. - stripAutoDiffDecorations(module); - // Remove keep-alive decorations from null-differential type // so it can be DCE'd if unused. // |
