From fc54adee1f7f0ba18591fc84ce5d51ac23afa954 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 26 Apr 2023 17:37:04 -0700 Subject: Autodiff support for dynamically dispatched generic method. (#2846) * Autodiff support for dynamically dispatched generic method. * Fix. * Support dynamically dispatched generic type. --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index e74a57424..eefcb9eea 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -7067,6 +7067,8 @@ namespace Slang // and then destroy it (it had better have no uses!) void IRInst::removeAndDeallocate() { + removeAndDeallocateAllDecorationsAndChildren(); + if (auto module = getModule()) { if (getIROpInfo(getOp()).isHoistable()) @@ -7080,7 +7082,6 @@ namespace Slang module->getDeduplicationContext()->getInstReplacementMap().remove(this); } removeArguments(); - removeAndDeallocateAllDecorationsAndChildren(); removeFromParent(); // Run destructor to be sure... -- cgit v1.2.3