aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4ssa.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2014-11-05 11:27:15 +0100
committerFawzi Mohamed <fawzi.mohamed@theqtcompany.com>2014-11-05 16:26:20 +0100
commitb74268ef3e82f0fb9c1ed5392efd0e19c08ee5d5 (patch)
treed4556df10504b80a23371ac357a76e0916f36fe5 /src/qml/compiler/qv4ssa.cpp
parent77711c65c1fdb6c5d94d26fef828959d29643516 (diff)
qv4: assign split of edges to loop header to the correct group
(i.e assign split edges to the correct loop group, now for real) The fix of 25b6fae1eb26645a30b3e7e254ce0b585757351c did try fix QTBUG-41766 and simplify the logic to assign the inserted statement to a loop group. Unfortunately that was incorrect if the target basic block starts a group. In that case if the source was already inside the group we should add it to the target basic block, otherwise to the one containing the target block (as before). There was no visible regression caused by this. Change-Id: Id50c42305fc5ac6aedaffa89d8f8dc3b5e976aa4 Task-number: QTBUG-41766 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r--src/qml/compiler/qv4ssa.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 31e3ed867e..d2222a0458 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -2991,7 +2991,19 @@ void splitCriticalEdges(IR::Function *f, DominatorTree &df, StatementWorklist &w
toBB->in[inIdx] = newBB;
newBB->out.append(toBB);
- newBB->setContainingGroup(toBB->containingGroup());
+ // add newBB to the correct loop group
+ if (toBB->isGroupStart()) {
+ BasicBlock *container;
+ for (container = fromBB->containingGroup(); container; container = container->containingGroup())
+ if (container == toBB)
+ break;
+ if (container == toBB) // if we were already inside the toBB loop
+ newBB->setContainingGroup(toBB);
+ else
+ newBB->setContainingGroup(toBB->containingGroup());
+ } else {
+ newBB->setContainingGroup(toBB->containingGroup());
+ }
// patch the terminator
Stmt *terminator = fromBB->terminator();