diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-06-30 10:33:26 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-05 19:50:15 +0200 |
| commit | 5e4a1738b05f6f188eada38f1805018bdccc1c96 (patch) | |
| tree | 812623e95929ef77a477d0680ce1dbbd062bb105 /tests/auto/qml/qmlcppcodegen/data | |
| parent | cd383f8406746a99f3cd7b51d2ef3dfdb9a0dd9f (diff) | |
QmlCompiler: Fix register propagation in basic blocks pass
a, We were recording too many jump origins and targets. That messed up
the basic blocks ordering logic.
b, In the presence of backward jumps, we need to revisit earlier basic
blocks if additional writes are discovered. Otherwise the type
adjustment will optimize "dead" type conversions out.
Pick-to: 6.4
Fixes: QTBUG-104665
Change-Id: I7219f85625761817ae4f63582d80d247a85df73b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/registerPropagation.qml | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt index 5db02b5253..61a39a6361 100644 --- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt +++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt @@ -121,6 +121,7 @@ set(qml_files prefixedMetaType.qml pressAndHoldButton.qml registerelimination.qml + registerPropagation.qml revisions.qml scopeVsObject.qml script.js diff --git a/tests/auto/qml/qmlcppcodegen/data/registerPropagation.qml b/tests/auto/qml/qmlcppcodegen/data/registerPropagation.qml new file mode 100644 index 0000000000..e95ef3ece4 --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/registerPropagation.qml @@ -0,0 +1,16 @@ +import QML + +QtObject { + function test() : int { + var i = 0, x; + while (i == 0) { + x = 1; + i = 1; + } + + if (i == 1) + return x; + + return 0 + } +} |
