summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-12 19:55:41 -0700
committerGitHub <noreply@github.com>2023-07-12 19:55:41 -0700
commitf3aba255f6d69ddbf255b33d0eb0f391908e60a8 (patch)
treef43300b1bbbcc82caa1b547dd3922c608010cb98 /source/slang/slang-lower-to-ir.cpp
parent98ba936ed91328338ba95525dd658d5cde6582de (diff)
Pool inst worklists and hashsets to avoid rehashing. (#2982)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index b941212ea..4ff14fba7 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -8204,7 +8204,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
child = child->getParent();
return child != nullptr;
}
- static void markInstsToClone(HashSet<IRInst*>& valuesToClone, IRInst* parentBlock, IRInst* value)
+ static void markInstsToClone(InstHashSet& valuesToClone, IRInst* parentBlock, IRInst* value)
{
if (!isChildOf(value, parentBlock))
return;
@@ -8264,7 +8264,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
IRCloneEnv cloneEnv = {};
if (returnType)
{
- HashSet<IRInst*> valuesToClone;
+ InstHashSet valuesToClone(subBuilder->getModule());
markInstsToClone(valuesToClone, parentGeneric->getFirstBlock(), returnType);
// For Function Types, we always clone all generic parameters regardless of whether
// the generic parameter appears in the function signature or not.