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-inline.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-inline.cpp') 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* 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* modifiedFuncs) { SLANG_PROFILE; MandatoryEarlyInliningPass pass(module); - pass.considerAllCallSites(); + pass.m_modifiedFuncs = modifiedFuncs; + return pass.considerAllCallSites(); } namespace { // anonymous -- cgit v1.2.3