1 ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s
3 ; Check that unused vregs aren't assigned registers.
5 target triple = "wasm32-unknown-unknown"
7 define void @foo(ptr nocapture %a, i32 %w, i32 %h) {
9 ; CHECK-NEXT: .functype foo (i32, i32, i32) -> (){{$}}
10 ; CHECK-NEXT: .local i32, i32, i32, i32, i32, i32{{$}}
12 %cmp.19 = icmp sgt i32 %h, 0
13 br i1 %cmp.19, label %for.cond.1.preheader.lr.ph, label %for.end.7
15 for.cond.1.preheader.lr.ph:
16 %cmp2.17 = icmp sgt i32 %w, 0
17 br label %for.cond.1.preheader
20 %y.020 = phi i32 [ 0, %for.cond.1.preheader.lr.ph ], [ %inc6, %for.inc.5 ]
21 br i1 %cmp2.17, label %for.body.3.lr.ph, label %for.inc.5
24 %mul4 = mul nsw i32 %y.020, %w
28 %x.018 = phi i32 [ 0, %for.body.3.lr.ph ], [ %inc, %for.body.3 ]
29 %mul = mul nsw i32 %x.018, %y.020
30 %add = add nsw i32 %x.018, %mul4
31 %arrayidx = getelementptr inbounds i32, ptr %a, i32 %add
32 store i32 %mul, ptr %arrayidx, align 4
33 %inc = add nuw nsw i32 %x.018, 1
34 %exitcond = icmp eq i32 %inc, %w
35 br i1 %exitcond, label %for.inc.5.loopexit, label %for.body.3
41 %inc6 = add nuw nsw i32 %y.020, 1
42 %exitcond22 = icmp eq i32 %inc6, %h
43 br i1 %exitcond22, label %for.end.7.loopexit, label %for.cond.1.preheader