summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-09-18 21:53:32 -0700
committerGitHub <noreply@github.com>2023-09-18 21:53:32 -0700
commit6bab227860a6873204141e5ec9b14ed08d77fc62 (patch)
treeafd006c5ad6620d04763b67b62c3b0ec1091ee21 /src
parent8c5bb9b8a0b150ebab0d0dec545206b055de9564 (diff)
downloadbinaryen-6bab227860a6873204141e5ec9b14ed08d77fc62.tar.gz
binaryen-6bab227860a6873204141e5ec9b14ed08d77fc62.tar.bz2
binaryen-6bab227860a6873204141e5ec9b14ed08d77fc62.zip
Do not optimize tuple locals in StackIR local2stack (#5958)
This Stack IR optimization is not compatible with a much more powerful optimization we plan to do for tuples in the binary writer.
Diffstat (limited to 'src')
-rw-r--r--src/passes/StackIR.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/passes/StackIR.cpp b/src/passes/StackIR.cpp
index 438ed8b55..bc91d0703 100644
--- a/src/passes/StackIR.cpp
+++ b/src/passes/StackIR.cpp
@@ -194,7 +194,11 @@ private:
// This is something we should handle, look into it.
if (inst->type.isConcrete()) {
bool optimized = false;
- if (auto* get = inst->origin->dynCast<LocalGet>()) {
+ // Do not optimize multivalue locals, since those will be better
+ // optimized when they are visited in the binary writer and this
+ // optimization would intefere with that one.
+ if (auto* get = inst->origin->dynCast<LocalGet>();
+ get && inst->type.isSingle()) {
// This is a potential optimization opportunity! See if we
// can reach the set.
if (values.size() > 0) {