From 0629b22bf09ae6b3c3689c5f98492df7577bf0d2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 8 Mar 2024 18:08:24 -0800 Subject: Enhance link-time type test. (#3724) * Enhance link-time type test. * Fix. * Fix. --- source/slang/slang-emit.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 1d72fd233..5ec6fa62a 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -491,6 +491,11 @@ Result linkAndOptimizeIR( validateIRModuleIfEnabled(codeGenContext, irModule); + // If we have any witness tables that are marked as `KeepAlive`, + // but are not used for dynamic dispatch, unpin them so we don't + // do unnecessary work to lower them. + unpinWitnessTables(irModule); + simplifyIR(targetProgram, irModule, IRSimplificationOptions::getFast(), sink); if (!ArtifactDescUtil::isCpuLikeTarget(artifactDesc)) -- cgit v1.2.3