summaryrefslogtreecommitdiff
path: root/src/passes/MergeSimilarFunctions.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-03-16 14:24:52 -0700
committerGitHub <noreply@github.com>2023-03-16 14:24:52 -0700
commitbd43ae2e3fc8e32a914609967fe4ff67ef025736 (patch)
tree051c80c95b3f145065b41e01c246f28f1b7461bb /src/passes/MergeSimilarFunctions.cpp
parentda143ddde34854d6ac5de38cf93d60a427e30dc6 (diff)
downloadbinaryen-bd43ae2e3fc8e32a914609967fe4ff67ef025736.tar.gz
binaryen-bd43ae2e3fc8e32a914609967fe4ff67ef025736.tar.bz2
binaryen-bd43ae2e3fc8e32a914609967fe4ff67ef025736.zip
Handle ReturnCall in MergeSimilarFunctions (#5581)
Fixes #5580
Diffstat (limited to 'src/passes/MergeSimilarFunctions.cpp')
-rw-r--r--src/passes/MergeSimilarFunctions.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/passes/MergeSimilarFunctions.cpp b/src/passes/MergeSimilarFunctions.cpp
index 8e039566a..525d7c38f 100644
--- a/src/passes/MergeSimilarFunctions.cpp
+++ b/src/passes/MergeSimilarFunctions.cpp
@@ -565,7 +565,9 @@ Function* EquivalentClass::createShared(Module* module,
operands.push_back(
ExpressionManipulator::flexibleCopy(operand, *module, copier));
}
- return builder.makeCallRef(paramExpr, operands, call->type);
+ auto returnType = module->getFunction(call->target)->getResults();
+ return builder.makeCallRef(
+ paramExpr, operands, returnType, call->isReturn);
}
}
}
@@ -616,6 +618,7 @@ EquivalentClass::replaceWithThunk(Builder& builder,
callOperands.push_back(value);
}
+ // TODO: make a return_call when possible?
auto ret = builder.makeCall(shared->name, callOperands, target->getResults());
target->vars.clear();
target->body = ret;