75 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -wasm-keep-registers | FileCheck %s3; RUN: llc < %s -wasm-keep-registers -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=FAST4 5target triple = "wasm32-unknown-unknown"6 7define i32 @return_i32(i32 %p) {8; CHECK-LABEL: return_i32:9; CHECK: .functype return_i32 (i32) -> (i32)10; CHECK-NEXT: # %bb.0:11; CHECK-NEXT: local.get $push0=, 012; CHECK-NEXT: # fallthrough-return13;14; FAST-LABEL: return_i32:15; FAST: .functype return_i32 (i32) -> (i32)16; FAST-NEXT: # %bb.0:17; FAST-NEXT: local.get $push0=, 018; FAST-NEXT: # fallthrough-return19 ret i32 %p20}21 22define i32 @return_i32_twice(i32 %a) {23; CHECK-LABEL: return_i32_twice:24; CHECK: .functype return_i32_twice (i32) -> (i32)25; CHECK-NEXT: # %bb.0:26; CHECK-NEXT: block27; CHECK-NEXT: local.get $push6=, 028; CHECK-NEXT: i32.eqz $push7=, $pop629; CHECK-NEXT: br_if 0, $pop7 # 0: down to label030; CHECK-NEXT: # %bb.1: # %true31; CHECK-NEXT: i32.const $push3=, 032; CHECK-NEXT: i32.const $push5=, 033; CHECK-NEXT: i32.store 0($pop3), $pop534; CHECK-NEXT: i32.const $push4=, 135; CHECK-NEXT: return $pop436; CHECK-NEXT: .LBB1_2: # %false37; CHECK-NEXT: end_block # label0:38; CHECK-NEXT: i32.const $push1=, 039; CHECK-NEXT: i32.const $push0=, 240; CHECK-NEXT: i32.store 0($pop1), $pop041; CHECK-NEXT: i32.const $push2=, 342; CHECK-NEXT: # fallthrough-return43;44; FAST-LABEL: return_i32_twice:45; FAST: .functype return_i32_twice (i32) -> (i32)46; FAST-NEXT: # %bb.0:47; FAST-NEXT: block48; FAST-NEXT: local.get $push6=, 049; FAST-NEXT: i32.eqz $push7=, $pop650; FAST-NEXT: br_if 0, $pop7 # 0: down to label051; FAST-NEXT: # %bb.1: # %true52; FAST-NEXT: i32.const $push4=, 053; FAST-NEXT: i32.const $push5=, 054; FAST-NEXT: i32.store 0($pop4), $pop555; FAST-NEXT: i32.const $push3=, 156; FAST-NEXT: return $pop357; FAST-NEXT: .LBB1_2: # %false58; FAST-NEXT: end_block # label0:59; FAST-NEXT: i32.const $push1=, 060; FAST-NEXT: i32.const $push2=, 261; FAST-NEXT: i32.store 0($pop1), $pop262; FAST-NEXT: i32.const $push0=, 363; FAST-NEXT: # fallthrough-return64 %b = icmp ne i32 %a, 065 br i1 %b, label %true, label %false66 67true:68 store i32 0, ptr null69 ret i32 170 71false:72 store i32 2, ptr null73 ret i32 374}75