diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-29 11:14:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-29 11:14:22 -0700 |
| commit | 83f176ba8a3bae5533470aed6a90663653f894b8 (patch) | |
| tree | 3e39a674cb4662c946598526f633302f139e14ab /source/slang/slang-ir-uniformity.cpp | |
| parent | c1e34c5a29d99d8a70b4e78313bfd3d539d9206e (diff) | |
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.
Diffstat (limited to 'source/slang/slang-ir-uniformity.cpp')
| -rw-r--r-- | source/slang/slang-ir-uniformity.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
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<IRInst*>& workList) { - List<IRInst*>& nextWorkList = *module->getContainerPool().getList<IRInst>(); - HashSet<IRInst*>& workListSet = *module->getContainerPool().getHashSet<IRInst>(); + 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<IRInst*>& workList = *module->getContainerPool().getList<IRInst>(); + InstWorkList workList(module); + for (auto globalInst : module->getGlobalInsts()) { if (auto code = as<IRGlobalValueWithCode>(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<IRInst*>& workList = *module->getContainerPool().getList<IRInst>(); + InstWorkList workList(module); workList.add(module->getModuleInst()); for (Index i = 0; i < workList.getCount(); i++) { |
