summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-04-10 19:39:12 -0700
committerGitHub <noreply@github.com>2019-04-10 19:39:12 -0700
commit6b517f6f70d5af72ed5d217a307a0b9b9284be24 (patch)
treeb946205a2c229abff129b67b5f89a33f44a7469f /src
parent7be5d23122aba2791fb6ff382bcaa19388a72932 (diff)
downloadbinaryen-6b517f6f70d5af72ed5d217a307a0b9b9284be24.tar.gz
binaryen-6b517f6f70d5af72ed5d217a307a0b9b9284be24.tar.bz2
binaryen-6b517f6f70d5af72ed5d217a307a0b9b9284be24.zip
don't precompute anything to a vector for now (#1999)
We handled this for the normal case, but the optimizer can also precompute a return into a value, so check the output of the precomputation as well.
Diffstat (limited to 'src')
-rw-r--r--src/passes/Precompute.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index 6f59fceb7..50c17510f 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -168,9 +168,10 @@ struct Precompute : public WalkerPass<PostWalker<Precompute, UnifiedExpressionVi
// 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;
+ if (isVectorType(curr->type)) return;
// try to evaluate this into a const
Flow flow = precomputeExpression(curr);
+ if (isVectorType(flow.value.type)) return;
if (flow.breaking()) {
if (flow.breakTo == NOTPRECOMPUTABLE_FLOW) return;
if (flow.breakTo == RETURN_FLOW) {