[PATCH] D146533: [WebAssembly] Fix i64_i64_func_i64_i64_i32 type signature when multivalue feature is enabled

Congcong Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 15:54:31 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG696fdece49e5: [WebAssembly] Fix i64_i64_func_i64_i64_i32 type signature when multivalue… (authored by HerrCai0907).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146533/new/

https://reviews.llvm.org/D146533

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
  llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll


Index: llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll
===================================================================
--- llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll
+++ llvm/test/CodeGen/WebAssembly/multivalue_libcall.ll
@@ -96,3 +96,48 @@
   %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
+}
Index: llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
@@ -772,8 +772,6 @@
     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);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146533.507168.patch
Type: text/x-patch
Size: 2582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230321/91444bc1/attachment.bin>


More information about the llvm-commits mailing list