163 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc < %s --mtriple=wasm32-unknown-unknown -mcpu=mvp -mattr=+reference-types -mattr=+gc -verify-machineinstrs | FileCheck --check-prefixes CHECK,CHK32 %s3; RUN: llc < %s --mtriple=wasm64-unknown-unknown -mcpu=mvp -mattr=+reference-types -mattr=+gc -verify-machineinstrs | FileCheck --check-prefixes CHECK,CHK64 %s4 5define void @test_fpsig_void_void(ptr noundef %func) local_unnamed_addr #0 {6; CHECK-LABEL: test_fpsig_void_void:7; CHK32: .functype test_fpsig_void_void (i32) -> ()8; CHK64: .functype test_fpsig_void_void (i64) -> ()9; CHECK-NEXT: # %bb.0: # %entry10; CHECK-NEXT: local.get 011; CHK64-NEXT: i32.wrap_i6412; CHECK-NEXT: table.get __indirect_function_table13; CHECK-NEXT: ref.test () -> ()14; CHECK-NEXT: call use15; CHECK-NEXT: # fallthrough-return16entry:17 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func)18 tail call void @use(i32 noundef %res) #319 ret void20}21 22define void @test_fpsig_return_i32(ptr noundef %func) local_unnamed_addr #0 {23; CHECK-LABEL: test_fpsig_return_i32:24; CHK32: .functype test_fpsig_return_i32 (i32) -> ()25; CHK64: .functype test_fpsig_return_i32 (i64) -> ()26; CHECK-NEXT: # %bb.0: # %entry27; CHECK-NEXT: local.get 028; CHK64-NEXT: i32.wrap_i6429; CHECK-NEXT: table.get __indirect_function_table30; CHECK-NEXT: ref.test () -> (i32)31; CHECK-NEXT: call use32; CHECK-NEXT: # fallthrough-return33entry:34 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 poison)35 tail call void @use(i32 noundef %res) #336 ret void37}38 39define void @test_fpsig_return_i64(ptr noundef %func) local_unnamed_addr #0 {40; CHECK-LABEL: test_fpsig_return_i64:41; CHK32: .functype test_fpsig_return_i64 (i32) -> ()42; CHK64: .functype test_fpsig_return_i64 (i64) -> ()43; CHECK-NEXT: # %bb.0: # %entry44; CHECK-NEXT: local.get 045; CHK64-NEXT: i32.wrap_i6446; CHECK-NEXT: table.get __indirect_function_table47; CHECK-NEXT: ref.test () -> (i64)48; CHECK-NEXT: call use49; CHECK-NEXT: # fallthrough-return50entry:51 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i64 poison)52 tail call void @use(i32 noundef %res) #353 ret void54}55 56define void @test_fpsig_return_f32(ptr noundef %func) local_unnamed_addr #0 {57; CHECK-LABEL: test_fpsig_return_f32:58; CHK32: .functype test_fpsig_return_f32 (i32) -> ()59; CHK64: .functype test_fpsig_return_f32 (i64) -> ()60; CHECK-NEXT: # %bb.0: # %entry61; CHECK-NEXT: local.get 062; CHK64-NEXT: i32.wrap_i6463; CHECK-NEXT: table.get __indirect_function_table64; CHECK-NEXT: ref.test () -> (f32)65; CHECK-NEXT: call use66; CHECK-NEXT: # fallthrough-return67entry:68 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, float poison)69 tail call void @use(i32 noundef %res) #370 ret void71}72 73define void @test_fpsig_return_f64(ptr noundef %func) local_unnamed_addr #0 {74; CHECK-LABEL: test_fpsig_return_f64:75; CHK32: .functype test_fpsig_return_f64 (i32) -> ()76; CHK64: .functype test_fpsig_return_f64 (i64) -> ()77; CHECK-NEXT: # %bb.0: # %entry78; CHECK-NEXT: local.get 079; CHK64-NEXT: i32.wrap_i6480; CHECK-NEXT: table.get __indirect_function_table81; CHECK-NEXT: ref.test () -> (f64)82; CHECK-NEXT: call use83; CHECK-NEXT: # fallthrough-return84entry:85 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, double poison)86 tail call void @use(i32 noundef %res) #387 ret void88}89 90 91define void @test_fpsig_param_i32(ptr noundef %func) local_unnamed_addr #0 {92; CHECK-LABEL: test_fpsig_param_i32:93; CHK32: .functype test_fpsig_param_i32 (i32) -> ()94; CHK64: .functype test_fpsig_param_i32 (i64) -> ()95; CHECK-NEXT: # %bb.0: # %entry96; CHECK-NEXT: local.get 097; CHK64-NEXT: i32.wrap_i6498; CHECK-NEXT: table.get __indirect_function_table99; CHECK-NEXT: ref.test (f64) -> ()100; CHECK-NEXT: call use101; CHECK-NEXT: # fallthrough-return102entry:103 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token poison, double poison)104 tail call void @use(i32 noundef %res) #3105 ret void106}107 108 109define void @test_fpsig_multiple_params_and_returns(ptr noundef %func) local_unnamed_addr #0 {110; CHECK-LABEL: test_fpsig_multiple_params_and_returns:111; CHK32: .functype test_fpsig_multiple_params_and_returns (i32) -> ()112; CHK64: .functype test_fpsig_multiple_params_and_returns (i64) -> ()113; CHECK-NEXT: # %bb.0: # %entry114; CHECK-NEXT: local.get 0115; CHK64-NEXT: i32.wrap_i64116; CHECK-NEXT: table.get __indirect_function_table117; CHECK-NEXT: ref.test (i64, f32, i64) -> (i32, i64, f32, f64)118; CHECK-NEXT: call use119; CHECK-NEXT: # fallthrough-return120entry:121 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 poison, i64 poison, float poison, double poison, token poison, i64 poison, float poison, i64 poison)122 tail call void @use(i32 noundef %res) #3123 ret void124}125 126 127define void @test_fpsig_ptrs(ptr noundef %func) local_unnamed_addr #0 {128; CHECK-LABEL: test_fpsig_ptrs:129; CHK32: .functype test_fpsig_ptrs (i32) -> ()130; CHK64: .functype test_fpsig_ptrs (i64) -> ()131; CHECK-NEXT: # %bb.0: # %entry132; CHECK-NEXT: local.get 0133; CHK64-NEXT: i32.wrap_i64134; CHECK-NEXT: table.get __indirect_function_table135; CHK32-NEXT: ref.test (i32, i32) -> (i32)136; CHK64-NEXT: ref.test (i64, i64) -> (i64)137; CHECK-NEXT: call use138; CHECK-NEXT: # fallthrough-return139entry:140 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, ptr poison, token poison, ptr poison, ptr poison)141 tail call void @use(i32 noundef %res) #3142 ret void143}144 145define void @test_reference_types(ptr noundef %func) local_unnamed_addr #0 {146; CHECK-LABEL: test_reference_types:147; CHK32: .functype test_reference_types (i32) -> ()148; CHK64: .functype test_reference_types (i64) -> ()149; CHECK-NEXT: # %bb.0: # %entry150; CHECK-NEXT: local.get 0151; CHK64-NEXT: i32.wrap_i64152; CHECK-NEXT: table.get __indirect_function_table153; CHECK-NEXT: ref.test (funcref, externref) -> (externref)154; CHECK-NEXT: call use155; CHECK-NEXT: # fallthrough-return156entry:157 %res = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, ptr addrspace(10) poison, token poison, ptr addrspace(20) poison, ptr addrspace(10) poison)158 tail call void @use(i32 noundef %res) #3159 ret void160}161 162declare void @use(i32 noundef) local_unnamed_addr #1163