File: dead-vreg.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (50 lines) | stat: -rw-r--r-- 1,446 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s

; Check that unused vregs aren't assigned registers.

target triple = "wasm32-unknown-unknown"

define void @foo(ptr nocapture %a, i32 %w, i32 %h) {
; CHECK-LABEL: foo:
; CHECK-NEXT: .functype foo (i32, i32, i32) -> (){{$}}
; CHECK-NEXT: .local i32, i32, i32, i32, i32, i32{{$}}
entry:
  %cmp.19 = icmp sgt i32 %h, 0
  br i1 %cmp.19, label %for.cond.1.preheader.lr.ph, label %for.end.7

for.cond.1.preheader.lr.ph:
  %cmp2.17 = icmp sgt i32 %w, 0
  br label %for.cond.1.preheader

for.cond.1.preheader:
  %y.020 = phi i32 [ 0, %for.cond.1.preheader.lr.ph ], [ %inc6, %for.inc.5 ]
  br i1 %cmp2.17, label %for.body.3.lr.ph, label %for.inc.5

for.body.3.lr.ph:
  %mul4 = mul nsw i32 %y.020, %w
  br label %for.body.3

for.body.3:
  %x.018 = phi i32 [ 0, %for.body.3.lr.ph ], [ %inc, %for.body.3 ]
  %mul = mul nsw i32 %x.018, %y.020
  %add = add nsw i32 %x.018, %mul4
  %arrayidx = getelementptr inbounds i32, ptr %a, i32 %add
  store i32 %mul, ptr %arrayidx, align 4
  %inc = add nuw nsw i32 %x.018, 1
  %exitcond = icmp eq i32 %inc, %w
  br i1 %exitcond, label %for.inc.5.loopexit, label %for.body.3

for.inc.5.loopexit:
  br label %for.inc.5

for.inc.5:
  %inc6 = add nuw nsw i32 %y.020, 1
  %exitcond22 = icmp eq i32 %inc6, %h
  br i1 %exitcond22, label %for.end.7.loopexit, label %for.cond.1.preheader

for.end.7.loopexit:
  br label %for.end.7

for.end.7:
  ret void
}