From 83f176ba8a3bae5533470aed6a90663653f894b8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 29 May 2024 11:14:22 -0700 Subject: Add options to speedup compilation. (#4240) * Add options to speedup compilation. * Fix. * Plumb options to DCE pass. * Revert debug change. * Fix regressions. * More optimizations. * more cleanup and fixes. * remove comment. * Fixes. * Another fix. * Fix errors. * Fix errors. * Add comments. --- source/slang/slang-ir-uniformity.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/slang/slang-ir-uniformity.cpp') diff --git a/source/slang/slang-ir-uniformity.cpp b/source/slang/slang-ir-uniformity.cpp index e09b6d89c..6f81e85f0 100644 --- a/source/slang/slang-ir-uniformity.cpp +++ b/source/slang/slang-ir-uniformity.cpp @@ -191,8 +191,9 @@ namespace Slang void propagateNonUniform(IRFunc* root, List& workList) { - List& nextWorkList = *module->getContainerPool().getList(); - HashSet& workListSet = *module->getContainerPool().getHashSet(); + InstWorkList nextWorkList(module); + InstHashSet workListSet(module); + auto addToWorkList = [&](IRInst* inst) { if (workListSet.add(inst)) @@ -404,14 +405,15 @@ namespace Slang addToWorkList(user); } } - workList.swapWith(nextWorkList); + workList.swapWith(nextWorkList.getList()); nextWorkList.clear(); } } void analyzeModule() { - List& workList = *module->getContainerPool().getList(); + InstWorkList workList(module); + for (auto globalInst : module->getGlobalInsts()) { if (auto code = as(globalInst)) @@ -438,7 +440,7 @@ namespace Slang } currentCallee = func; call = nullptr; - propagateNonUniform(func, workList); + propagateNonUniform(func, workList.getList()); } } workList.clear(); @@ -448,7 +450,7 @@ namespace Slang void eliminateAsDynamicUniformInst() { - List& workList = *module->getContainerPool().getList(); + InstWorkList workList(module); workList.add(module->getModuleInst()); for (Index i = 0; i < workList.getCount(); i++) { -- cgit v1.2.3