From 9ee2df1e3b648d706805ef1e32c853c19d27e1a2 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 16 Feb 2022 16:34:56 +0100 Subject: QmlCompiler: Add basic block analysis pass This basic block analysis pass uses the tracked types to determine dead stores. This is better than the one we already have in the code generator because it also tracks dead stores through renames and it allows removal of lookup results. Furthermore, it adjusts each store to write the type most favorable to its readers. This avoids unnecessary conversions at run time. It cannot replace the other dead store elimination, yet, because it doesn't see whether the results of rename operations are read after the rename. This capability will be added in a separate change that also tracks the register numbers. Once this is in place, we can delete the other basic blocks pass. Task-number: QTBUG-100157 Change-Id: I766c919412b6cf43befa7bdb1a6e5e11b41fe55b Reviewed-by: Fabian Kosmale --- src/qmlcompiler/qqmljscompiler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qmlcompiler/qqmljscompiler.cpp') diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp index 30b74fe6ee..c765a1c94e 100644 --- a/src/qmlcompiler/qqmljscompiler.cpp +++ b/src/qmlcompiler/qqmljscompiler.cpp @@ -29,6 +29,7 @@ #include "qqmljscompiler_p.h" #include +#include #include #include #include @@ -768,6 +769,9 @@ QQmlJSAotFunction QQmlJSAotCompiler::doCompile( if (error->isValid()) return compileError(); + QQmlJSBasicBlocks basicBlocks(m_unitGenerator, &m_typeResolver, m_logger); + typePropagationResult = basicBlocks.run(function, typePropagationResult); + QQmlJSShadowCheck shadowCheck(m_unitGenerator, &m_typeResolver, m_logger); shadowCheck.run(&typePropagationResult, function, error); if (error->isValid()) -- cgit v1.2.3