summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/Precompute.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index a832c9e85..fa6e8e9ed 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -172,17 +172,8 @@ struct Precompute
if (Properties::isConstantExpression(curr) || curr->is<Nop>()) {
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.isVector()) {
- return;
- }
// try to evaluate this into a const
Flow flow = precomputeExpression(curr);
- if (flow.getType().hasVector()) {
- return;
- }
if (!canEmitConstantFor(flow.values)) {
return;
}
@@ -236,6 +227,12 @@ private:
// Precompute an expression, returning a flow, which may be a constant
// (that we can replace the expression with if replaceExpression is set).
Flow precomputeExpression(Expression* curr, bool replaceExpression = true) {
+ // 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.isVector()) {
+ return Flow(NONCONSTANT_FLOW);
+ }
Flow flow;
try {
flow =
@@ -250,6 +247,9 @@ private:
!canEmitConstantFor(flow.values)) {
return Flow(NONCONSTANT_FLOW);
}
+ if (flow.getType().hasVector()) {
+ return Flow(NONCONSTANT_FLOW);
+ }
return flow;
}