diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-22 21:16:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-22 21:16:35 -0700 |
| commit | 259a015feb9d4ab65e8fbba32f6c777e92780cc7 (patch) | |
| tree | 45bd4cb9217325c67f5a27d8562b0e7e6b79bb77 /source/slang/slang-ir-clone.cpp | |
| parent | d4f99c8bac8b28f18c864a717d8833db6a1c872d (diff) | |
Type legalization and autodiff bug fixes. (#2722)
* Bug fixes.
* Fix.
* Only perform autodiff for functions whose derivative is actually used.
* Fix loop optimize bug.
* Fix high order diff.
* Fix trivial diff func generation.
* Fixes.
* Cleanup.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-clone.cpp')
| -rw-r--r-- | source/slang/slang-ir-clone.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/slang/slang-ir-clone.cpp b/source/slang/slang-ir-clone.cpp index 050d1e392..6ac9442ee 100644 --- a/source/slang/slang-ir-clone.cpp +++ b/source/slang/slang-ir-clone.cpp @@ -142,12 +142,9 @@ static void _cloneInstDecorationsAndChildren( // If `newInst` already has non-decoration children, we want to // insert the new children between the existing decoration and non-decoration children // so that we maintain the invariant that all decorations are defined before non-decorations. - if (auto lastDecor = newInst->getLastDecoration()) + if (auto firstChild = newInst->getFirstChild()) { - if (auto nextInstBeforeLastDecor = lastDecor->getNextInst()) - { - builder->setInsertBefore(nextInstBeforeLastDecor); - } + builder->setInsertBefore(firstChild); } // When applying the first phase of cloning to |
