brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · bd4a4b4 Raw
51 lines · plain
1; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s2 3; Check that unused vregs aren't assigned registers.4 5target triple = "wasm32-unknown-unknown"6 7define void @foo(ptr nocapture %a, i32 %w, i32 %h) {8; CHECK-LABEL: foo:9; CHECK-NEXT: .functype foo (i32, i32, i32) -> (){{$}}10; CHECK-NEXT: .local i32, i32, i32, i32, i32, i32{{$}}11entry:12  %cmp.19 = icmp sgt i32 %h, 013  br i1 %cmp.19, label %for.cond.1.preheader.lr.ph, label %for.end.714 15for.cond.1.preheader.lr.ph:16  %cmp2.17 = icmp sgt i32 %w, 017  br label %for.cond.1.preheader18 19for.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.522 23for.body.3.lr.ph:24  %mul4 = mul nsw i32 %y.020, %w25  br label %for.body.326 27for.body.3:28  %x.018 = phi i32 [ 0, %for.body.3.lr.ph ], [ %inc, %for.body.3 ]29  %mul = mul nsw i32 %x.018, %y.02030  %add = add nsw i32 %x.018, %mul431  %arrayidx = getelementptr inbounds i32, ptr %a, i32 %add32  store i32 %mul, ptr %arrayidx, align 433  %inc = add nuw nsw i32 %x.018, 134  %exitcond = icmp eq i32 %inc, %w35  br i1 %exitcond, label %for.inc.5.loopexit, label %for.body.336 37for.inc.5.loopexit:38  br label %for.inc.539 40for.inc.5:41  %inc6 = add nuw nsw i32 %y.020, 142  %exitcond22 = icmp eq i32 %inc6, %h43  br i1 %exitcond22, label %for.end.7.loopexit, label %for.cond.1.preheader44 45for.end.7.loopexit:46  br label %for.end.747 48for.end.7:49  ret void50}51