From 0f41b0708384c1f5d85304d5ed94d9edd57d38c9 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 19 Dec 2018 19:22:09 -0800 Subject: Do not precompute v128 expressions (#1839) Without this change, sequences like `i32.const 0, i32x4.splat` will get precomputed to v128.const ops, which are much larger and also not implemented in V8 yet. Until we have SIMD-aware optimization passes or at least engine support for v128.const, do not perform such transformations. --- src/passes/Precompute.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index 9fb7ab31c..042a8be20 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -161,6 +161,10 @@ struct Precompute : public WalkerPassis() || curr->is()) return; + // Until engines implement v128.const and we have SIMD-aware optimizations + // that can break large v128.const instructions into smaller consts and + // splats, do not try to precompute v128 expressions. + if (curr->type == v128) return; // try to evaluate this into a const Flow flow = precomputeExpression(curr); if (flow.breaking()) { -- cgit v1.2.3