diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-16 16:34:56 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-09 12:40:06 +0100 |
commit | 9ee2df1e3b648d706805ef1e32c853c19d27e1a2 (patch) | |
tree | 67795bace9e2ad26d9c4c1f176423e8b313ba794 /src/qmlcompiler/qqmljscompiler.cpp | |
parent | e86019ecbddd76d6551a18595ef9dcff8560f1d4 (diff) | |
download | qtdeclarative-9ee2df1e3b648d706805ef1e32c853c19d27e1a2.tar.gz |
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r-- | src/qmlcompiler/qqmljscompiler.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <private/qqmlirbuilder_p.h> +#include <private/qqmljsbasicblocks_p.h> #include <private/qqmljscodegenerator_p.h> #include <private/qqmljsfunctioninitializer_p.h> #include <private/qqmljsimportvisitor_p.h> @@ -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()) |