Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Add missing utility methods for exnref type
Summary: This adds missing utility methods and copy instruction handling for `exnref` type and also adds tests. `tee` instruction tests are missing because `isTee` is currently only used in ExplicitLocals pass and testing that pass in mir requires serialization of stackified registers in mir files, which is a bit nontrivial because `MachineFunctionInfo` only has info of vreg numbers (which are large integers) but not the mir's register numbers. But this change is quite trivial anyway. Reviewers: tlively Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64705 llvm-svn: 366149
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 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
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,59 @@ | ||
# RUN: llc -mtriple=wasm32-unknown-unknown %s -o - -run-pass wasm-argument-move | FileCheck %s | ||
|
||
# wasm-argument-move pass moves all ARGUMENT instructions to the top of the | ||
# entry BB. | ||
--- | ||
name: argument_i32 | ||
# CHECK-LABEL: argument_i32 | ||
body: | | ||
; CHECK-LABEL: bb.0: | ||
; CHECK-NEXT: %1:i32 = ARGUMENT_i32 0 | ||
bb.0: | ||
%0:i32 = CONST_I32 0, implicit-def $arguments | ||
%1:i32 = ARGUMENT_i32 0, implicit $arguments | ||
RETURN_VOID implicit-def $arguments | ||
... | ||
--- | ||
name: argument_i64 | ||
# CHECK-LABEL: argument_i64 | ||
body: | | ||
; CHECK-LABEL: bb.0: | ||
; CHECK-NEXT: %1:i64 = ARGUMENT_i64 0 | ||
bb.0: | ||
%0:i32 = CONST_I32 0, implicit-def $arguments | ||
%1:i64 = ARGUMENT_i64 0, implicit $arguments | ||
RETURN_VOID implicit-def $arguments | ||
... | ||
--- | ||
name: argument_f32 | ||
# CHECK-LABEL: argument_f32 | ||
body: | | ||
; CHECK-LABEL: bb.0: | ||
; CHECK-NEXT: %1:f32 = ARGUMENT_f32 0 | ||
bb.0: | ||
%0:i32 = CONST_I32 0, implicit-def $arguments | ||
%1:f32 = ARGUMENT_f32 0, implicit $arguments | ||
RETURN_VOID implicit-def $arguments | ||
... | ||
--- | ||
name: argument_f64 | ||
# CHECK-LABEL: argument_f64 | ||
body: | | ||
; CHECK-LABEL: bb.0: | ||
; CHECK-NEXT: %1:f64 = ARGUMENT_f64 0 | ||
bb.0: | ||
%0:i32 = CONST_I32 0, implicit-def $arguments | ||
%1:f64 = ARGUMENT_f64 0, implicit $arguments | ||
RETURN_VOID implicit-def $arguments | ||
... | ||
--- | ||
name: argument_exnref | ||
# CHECK-LABEL: argument_exnref | ||
body: | | ||
; CHECK-LABEL: bb.0: | ||
; CHECK-NEXT: %1:exnref = ARGUMENT_exnref 0 | ||
bb.0: | ||
%0:i32 = CONST_I32 0, implicit-def $arguments | ||
%1:exnref = ARGUMENT_exnref 0, implicit $arguments | ||
RETURN_VOID implicit-def $arguments | ||
... |
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