aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4ssa.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2014-11-04 14:55:26 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-04 17:02:14 +0100
commit25b6fae1eb26645a30b3e7e254ce0b585757351c (patch)
treecb8b7481750d75c32633dde2d106559a1b037dd0 /src/qml/compiler/qv4ssa.cpp
parent6cbb84d24f157cf630a87195e88cf700e1777ebf (diff)
qv4: assign split edges to the correct loop group
edge splitting had a strange logic to assign the inserted statement to a loop, which would go wrong for example for the statement just after the loop header. I guess that was done to increase the likelihood that the goto removed from the final instructions. Given that we are talking about critical edges it is always possible to emit them in a bad order, and I do not think that the old logic was really better than simply always use the loop group of the target which is always correct. It might be worthwhile to ensure that the block it is emitted just before the target block, or improve the handling of empty gotos in the backend, but in this patch we go for the simplest solution. If one would notice worse code, either one of the provious improvements could be done, or the old logic could be kept, changing just the if (container == 0) to container = toBB->containingGroup(); Change-Id: I26a488e9e2cb2b692fa8187ee658fb4dd98bfa8b Task-number: QTBUG-41766 Reviewed-by: Bernd Lamecker <bernd.lamecker@basyskom.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r--src/qml/compiler/qv4ssa.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index d67b88b718..31e3ed867e 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -2991,15 +2991,7 @@ void splitCriticalEdges(IR::Function *f, DominatorTree &df, StatementWorklist &w
toBB->in[inIdx] = newBB;
newBB->out.append(toBB);
- BasicBlock *container = 0;
- for (container = fromBB->containingGroup(); container; container = container->containingGroup()) {
- if (container == toBB || container == toBB->containingGroup())
- break;
- }
- if (container == 0)
- container = fromBB->containingGroup();
-
- newBB->setContainingGroup(container);
+ newBB->setContainingGroup(toBB->containingGroup());
// patch the terminator
Stmt *terminator = fromBB->terminator();