From 4cb3eeb832b5fb29a61f2934b3daa5e42a3d6cde Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 18 Jul 2023 08:08:11 -0700 Subject: Simplify Lookup and improve compiler performance. (#2996) * Simplify lookup. * Various bug fixes. * Report type dictionary size in perf benchmark. * Remove type duplication. * increase initial dict size. * Bug fix. * Fix bugs. * Fixup. * Revert type legalization looping. * Fix specialization pass. --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 35803cedb..b6c19b18d 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -6849,6 +6849,8 @@ namespace Slang thisInst = workItem.thisInst; other = workItem.otherInst; + SLANG_ASSERT(other); + // Safety check: don't try to replace something with itself. if (other == thisInst) continue; @@ -6902,6 +6904,8 @@ namespace Slang IRInst* existingVal = nullptr; if (dedupContext->getGlobalValueNumberingMap().tryGetValue(IRInstKey{ user }, existingVal)) { + // If existingVal has been replaced by something else, use that. + dedupContext->getInstReplacementMap().tryGetValue(existingVal, existingVal); addToWorkList(user, existingVal); } else -- cgit v1.2.3