[llvm] [WebAssembly] Don't return multivalue when Emscripten EH/SjLj is used (PR #86048)
Thomas Lively via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 20 17:48:45 PDT 2024
================
@@ -70,12 +71,12 @@ void llvm::computeSignatureVTs(const FunctionType *Ty,
computeLegalValueVTs(ContextFunc, TM, Ty->getReturnType(), Results);
MVT PtrVT = MVT::getIntegerVT(TM.createDataLayout().getPointerSizeInBits());
- if (Results.size() > 1 &&
- !TM.getSubtarget<WebAssemblySubtarget>(ContextFunc).hasMultivalue()) {
+ if (!WebAssembly::canLowerReturn(
+ Results.size(),
+ &TM.getSubtarget<WebAssemblySubtarget>(ContextFunc))) {
// WebAssembly can't lower returns of multiple values without demoting to
- // sret unless multivalue is enabled (see
- // WebAssemblyTargetLowering::CanLowerReturn). So replace multiple return
- // values with a poitner parameter.
+ // sret unless multivalue is enabled (see WebAssembly::canLowerReturn). So
+ // replace multiple return values with a poitner parameter.
----------------
tlively wrote:
```suggestion
// replace multiple return values with a pointer parameter.
```
https://github.com/llvm/llvm-project/pull/86048
More information about the llvm-commits
mailing list