diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp index 20891839686d..d87355e7d39b 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp @@ -772,8 +772,6 @@ void llvm::getLibcallSignature(const WebAssemblySubtarget &Subtarget, if (Subtarget.hasMultivalue()) { Rets.push_back(wasm::ValType::I64); Rets.push_back(wasm::ValType::I64); - Rets.push_back(wasm::ValType::I64); - Rets.push_back(wasm::ValType::I64); } else { Params.push_back(PtrTy); } diff --git a/llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll b/llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll index 682eb912b87b..47c5ae7b457d 100644 --- a/llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll +++ b/llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll @@ -96,3 +96,48 @@ define fp128 @multivalue_fsub(fp128 %a, fp128 %b) { %sub = fsub fp128 %a, %b ret fp128 %sub } + +define i128 @multivalue_lshr(i128 %a, i128 %b) { +; MULTIVALUE-LABEL: multivalue_lshr: +; MULTIVALUE: .functype multivalue_lshr (i64, i64, i64, i64) -> (i64, i64) +; MULTIVALUE-NEXT: # %bb.0: +; MULTIVALUE-NEXT: local.get 2 +; MULTIVALUE-NEXT: local.get 3 +; MULTIVALUE-NEXT: local.get 0 +; MULTIVALUE-NEXT: i32.wrap_i64 +; MULTIVALUE-NEXT: call __ashlti3 +; MULTIVALUE-NEXT: # fallthrough-return +; +; NO_MULTIVALUE-LABEL: multivalue_lshr: +; NO_MULTIVALUE: .functype multivalue_lshr (i32, i64, i64, i64, i64) -> () +; NO_MULTIVALUE-NEXT: .local i32 +; NO_MULTIVALUE-NEXT: # %bb.0: +; NO_MULTIVALUE-NEXT: global.get __stack_pointer +; NO_MULTIVALUE-NEXT: i32.const 16 +; NO_MULTIVALUE-NEXT: i32.sub +; NO_MULTIVALUE-NEXT: local.tee 5 +; NO_MULTIVALUE-NEXT: global.set __stack_pointer +; NO_MULTIVALUE-NEXT: local.get 5 +; NO_MULTIVALUE-NEXT: local.get 3 +; NO_MULTIVALUE-NEXT: local.get 4 +; NO_MULTIVALUE-NEXT: local.get 1 +; NO_MULTIVALUE-NEXT: i32.wrap_i64 +; NO_MULTIVALUE-NEXT: call __ashlti3 +; NO_MULTIVALUE-NEXT: local.get 0 +; NO_MULTIVALUE-NEXT: local.get 5 +; NO_MULTIVALUE-NEXT: i32.const 8 +; NO_MULTIVALUE-NEXT: i32.add +; NO_MULTIVALUE-NEXT: i64.load 0 +; NO_MULTIVALUE-NEXT: i64.store 8 +; NO_MULTIVALUE-NEXT: local.get 0 +; NO_MULTIVALUE-NEXT: local.get 5 +; NO_MULTIVALUE-NEXT: i64.load 0 +; NO_MULTIVALUE-NEXT: i64.store 0 +; NO_MULTIVALUE-NEXT: local.get 5 +; NO_MULTIVALUE-NEXT: i32.const 16 +; NO_MULTIVALUE-NEXT: i32.add +; NO_MULTIVALUE-NEXT: global.set __stack_pointer +; NO_MULTIVALUE-NEXT: # fallthrough-return + %tmp = shl i128 %b, %a + ret i128 %tmp +}