From 1c9b33157322751c456bf7abbd386edccf4413c3 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 14 Jan 2023 22:50:57 -0800 Subject: Support custom backward derivative attribute. (#2594) --- source/slang/slang-ir-util.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 73d8865ed..fb465f638 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -1,6 +1,7 @@ #include "slang-ir-util.h" #include "slang-ir-insts.h" #include "slang-ir-clone.h" +#include "slang-ir-dce.h" namespace Slang { @@ -198,6 +199,7 @@ IRInst* hoistValueFromGeneric(IRBuilder& inBuilder, IRInst* value, IRInst*& outS value->replaceUsesWith(outSpecializedVal); value->removeAndDeallocate(); } + eliminateDeadCode(newGeneric); return newGeneric; } -- cgit v1.2.3