1 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs | FileCheck %s
3 ; Test that phis are lowered.
5 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
11 ; CHECK: div_s $[[NUM0:[0-9]+]]=, $0, $pop[[NUM1:[0-9]+]]{{$}}
12 ; CHECK: return $[[NUM0]]{{$}}
13 define i32 @test0(i32 %p) {
15 %t = icmp slt i32 %p, 0
16 br i1 %t, label %true, label %done
21 %s = phi i32 [ %a, %true ], [ %p, %entry ]
28 ; CHECK: .LBB{{[0-9]+}}_1:
29 ; CHECK: local.copy $[[NUM0:[0-9]+]]=, $[[NUM1:[0-9]+]]{{$}}
30 ; CHECK: local.copy $[[NUM1]]=, $[[NUM2:[0-9]+]]{{$}}
31 ; CHECK: local.copy $[[NUM2]]=, $[[NUM0]]{{$}}
32 define i32 @test1(i32 %n) {
37 %a = phi i32 [ 0, %entry ], [ %b, %loop ]
38 %b = phi i32 [ 1, %entry ], [ %a, %loop ]
39 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
41 %i.next = add i32 %i, 1
42 %t = icmp slt i32 %i.next, %n
43 br i1 %t, label %loop, label %exit