aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemcc3
-rw-r--r--tools/js-optimizer.js5
2 files changed, 4 insertions, 4 deletions
diff --git a/emcc b/emcc
index 6e0761a7..df2ef38c 100755
--- a/emcc
+++ b/emcc
@@ -1621,9 +1621,6 @@ try:
js_optimizer_queue += [get_eliminate(), 'simplifyExpressions']
- if shared.Settings.RELOOP and not shared.Settings.ASM_JS:
- js_optimizer_queue += ['optimizeShiftsAggressive', get_eliminate()] # aggressive shifts optimization requires loops, it breaks on switches
-
if closure and not shared.Settings.ASM_JS:
flush_js_optimizer_queue()
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 7d72b7b8..e61317af 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -801,7 +801,10 @@ function simplifyExpressions(ast) {
// HEAP[x >> 2]
// very often. We can in some cases do the shift on the variable itself when it is set,
// to greatly reduce the number of shift operations.
-// TODO: when shifting a variable, if there are other uses, keep an unshifted version too, to prevent slowdowns?
+// XXX this optimization is deprecated and currently invalid: does not handle overflows
+// or non-aligned (round numbers, x >> 2 is a multiple of 4). Both are ok to assume
+// for pointers (undefined behavior otherwise), but invalid in general, and we do
+// no sufficiently-well distinguish the cases.
function optimizeShiftsInternal(ast, conservative) {
var MAX_SHIFTS = 3;
traverseGeneratedFunctions(ast, function(fun) {