From a588c1a5038cf2b4e22101d360fcae20531d905f Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 17 Dec 2013 12:44:07 +0100 Subject: V4 IR: do not add unconditional jumps to work lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both type inference and the optimization pass do not do anything with unconditional jumps. So, instead of adding them to the worklist and later on removing them again, it’s faster to never add them in the first place. Change-Id: Ib81d43e9ea6df2b1a70e9dd1e9b9c29cb6d345d2 Reviewed-by: Lars Knoll --- src/qml/compiler/qv4ssa.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/qml/compiler') diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index 5e1122e18b..b340cc9527 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -1636,7 +1636,8 @@ public: BasicBlock *bb = function->basicBlocks[i]; if (i == 0 || !bb->in.isEmpty()) foreach (Stmt *s, bb->statements) - _worklist.insert(s); + if (!s->asJump()) + _worklist.insert(s); } while (!_worklist.isEmpty()) { @@ -2886,6 +2887,8 @@ void optimizeSSA(Function *function, DefUsesCalculator &defUses) foreach (BasicBlock *bb, function->basicBlocks) { for (int i = 0, ei = bb->statements.size(); i != ei; ++i) { Stmt **s = &bb->statements[i]; + if ((*s)->asJump()) + continue; // nothing do do there W.append(*s); ref.insert(*s, s); } -- cgit v1.2.3