-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Webassembly][multivalue] update libcall signature when multivalue fe…
…ature enabled fixed: #59095 Update libcall signatures to use multivalue return rather than returning via a pointer when the multivalue features is enabled in the WebAssembly backend. Reviewed By: tlively Differential Revision: https://reviews.llvm.org/D146271
- Loading branch information
1 parent
4fa9dc9
commit d9661d7
Showing
2 changed files
with
123 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2 | ||
; RUN: llc < %s -verify-machineinstrs -mcpu=mvp -mattr=+multivalue | FileCheck %s --check-prefix=MULTIVALUE | ||
; RUN: llc < %s -verify-machineinstrs -mcpu=mvp | FileCheck %s --check-prefix=NO_MULTIVALUE | ||
|
||
; Test libcall signatures when multivalue is enabled and disabled | ||
|
||
target triple = "wasm32-unknown-unknown" | ||
|
||
@c = global i128 0, align 16 | ||
|
||
define void @multivalue_sdiv(i128 noundef %a, i128 noundef %b) #0 { | ||
; MULTIVALUE-LABEL: multivalue_sdiv: | ||
; MULTIVALUE: .functype multivalue_sdiv (i64, i64, i64, i64) -> () | ||
; MULTIVALUE-NEXT: # %bb.0: | ||
; MULTIVALUE-NEXT: local.get 0 | ||
; MULTIVALUE-NEXT: local.get 1 | ||
; MULTIVALUE-NEXT: local.get 2 | ||
; MULTIVALUE-NEXT: local.get 3 | ||
; MULTIVALUE-NEXT: call __divti3 | ||
; MULTIVALUE-NEXT: local.set 2 | ||
; MULTIVALUE-NEXT: local.set 3 | ||
; MULTIVALUE-NEXT: i32.const c | ||
; MULTIVALUE-NEXT: local.get 2 | ||
; MULTIVALUE-NEXT: i64.store 8 | ||
; MULTIVALUE-NEXT: i32.const 0 | ||
; MULTIVALUE-NEXT: local.get 3 | ||
; MULTIVALUE-NEXT: i64.store c | ||
; MULTIVALUE-NEXT: # fallthrough-return | ||
; | ||
; NO_MULTIVALUE-LABEL: multivalue_sdiv: | ||
; NO_MULTIVALUE: .functype multivalue_sdiv (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 4 | ||
; NO_MULTIVALUE-NEXT: global.set __stack_pointer | ||
; NO_MULTIVALUE-NEXT: local.get 4 | ||
; NO_MULTIVALUE-NEXT: local.get 0 | ||
; NO_MULTIVALUE-NEXT: local.get 1 | ||
; NO_MULTIVALUE-NEXT: local.get 2 | ||
; NO_MULTIVALUE-NEXT: local.get 3 | ||
; NO_MULTIVALUE-NEXT: call __divti3 | ||
; NO_MULTIVALUE-NEXT: i32.const c | ||
; NO_MULTIVALUE-NEXT: local.get 4 | ||
; 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: i32.const 0 | ||
; NO_MULTIVALUE-NEXT: local.get 4 | ||
; NO_MULTIVALUE-NEXT: i64.load 0 | ||
; NO_MULTIVALUE-NEXT: i64.store c | ||
; NO_MULTIVALUE-NEXT: local.get 4 | ||
; NO_MULTIVALUE-NEXT: i32.const 16 | ||
; NO_MULTIVALUE-NEXT: i32.add | ||
; NO_MULTIVALUE-NEXT: global.set __stack_pointer | ||
; NO_MULTIVALUE-NEXT: # fallthrough-return | ||
%div = sdiv i128 %a, %b | ||
store i128 %div, ptr @c, align 16 | ||
ret void | ||
} |