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-inline.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-inline.cpp')
| -rw-r--r-- | source/slang/slang-ir-inline.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/slang/slang-ir-inline.cpp b/source/slang/slang-ir-inline.cpp index a2ccc1ed7..0d5cb1c70 100644 --- a/source/slang/slang-ir-inline.cpp +++ b/source/slang/slang-ir-inline.cpp @@ -29,6 +29,8 @@ struct InliningPassBase /// The module that we are optimizing/transforming IRModule* m_module = nullptr; + HashSet<IRInst*>* m_modifiedFuncs = nullptr; + /// Initialize an inlining pass to operate on the given `module` InliningPassBase(IRModule* module) : m_module(module) @@ -157,6 +159,11 @@ struct InliningPassBase // given call site, we hand off the a worker routine // that does the meat of the work. // + if (m_modifiedFuncs) + { + if (auto parentFunc = getParentFunc(call)) + m_modifiedFuncs->add(parentFunc); + } inlineCallSite(callSite); return true; } @@ -698,12 +705,13 @@ struct MandatoryEarlyInliningPass : InliningPassBase }; -void performMandatoryEarlyInlining(IRModule* module) +bool performMandatoryEarlyInlining(IRModule* module, HashSet<IRInst*>* modifiedFuncs) { SLANG_PROFILE; MandatoryEarlyInliningPass pass(module); - pass.considerAllCallSites(); + pass.m_modifiedFuncs = modifiedFuncs; + return pass.considerAllCallSites(); } namespace { // anonymous |
