diff options
author | Lars Knoll <[email protected]> | 2014-02-09 21:11:16 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-02-22 16:48:00 +0100 |
commit | a5bb33e7cbea30fe9f3ea44d70afc37831683fc3 (patch) | |
tree | d4bc2635720653f5da801a508f030a467976b397 /src/qml/compiler/qv4ssa.cpp | |
parent | 48b44dc163953d78338dc884316344c377afd41f (diff) |
Really eliminate a|0 and b&(-1)
The old code wasn't doing what it promised to do
and failed to remove these expressions.
Change-Id: I6718539fd528f293db537e47ff1c9ac4b27ada55
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index dcee3ea4cd..83d0f24e98 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -3367,16 +3367,16 @@ void optimizeSSA(Function *function, DefUsesCalculator &defUses, DominatorTree & Expr *casted = 0; switch (binop->op) { case OpBitAnd: - if (leftConst && !rightConst && leftConst->value == 0xffffffff) - casted = rightConst; - else if (!leftConst && rightConst && rightConst->value == 0xffffffff) - casted = leftConst; + if (leftConst && !rightConst && QV4::Primitive::toUInt32(leftConst->value) == 0xffffffff) + casted = binop->right; + else if (!leftConst && rightConst && QV4::Primitive::toUInt32(rightConst->value) == 0xffffffff) + casted = binop->left; break; case OpBitOr: - if (leftConst && !rightConst && leftConst->value == 0) - casted = rightConst; - else if (!leftConst && rightConst && rightConst->value == 0) - casted = leftConst; + if (leftConst && !rightConst && QV4::Primitive::toInt32(leftConst->value) == 0) + casted = binop->right; + else if (!leftConst && rightConst && QV4::Primitive::toUInt32(rightConst->value) == 0) + casted = binop->left; break; default: break; |