File: req-regs.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (70 lines) | stat: -rw-r--r-- 2,745 bytes parent folder | download | duplicates (21)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; RUN: llc -mcpu=cyclone -debug-only=loop-reduce < %s 2>&1 | FileCheck %s
; REQUIRES: asserts

; LSR used to fail here due to a bug in the ReqRegs test.
; CHECK: The chosen solution requires
; CHECK-NOT: No Satisfactory Solution

target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios"

define void @do_integer_add(i64 %iterations, i8* nocapture readonly %cookie) {
entry:
  %N = bitcast i8* %cookie to i32*
  %0 = load i32, i32* %N, align 4
  %add = add nsw i32 %0, 57
  %cmp56 = icmp eq i64 %iterations, 0
  br i1 %cmp56, label %while.end, label %for.cond.preheader.preheader

for.cond.preheader.preheader:                     ; preds = %entry
  br label %for.cond.preheader

while.cond.loopexit:                              ; preds = %for.body
  %add21.lcssa = phi i32 [ %add21, %for.body ]
  %dec58 = add i64 %dec58.in, -1
  %cmp = icmp eq i64 %dec58, 0
  br i1 %cmp, label %while.end.loopexit, label %for.cond.preheader

for.cond.preheader:                               ; preds = %for.cond.preheader.preheader, %while.cond.loopexit
  %dec58.in = phi i64 [ %dec58, %while.cond.loopexit ], [ %iterations, %for.cond.preheader.preheader ]
  %a.057 = phi i32 [ %add21.lcssa, %while.cond.loopexit ], [ %add, %for.cond.preheader.preheader ]
  br label %for.body

for.body:                                         ; preds = %for.body, %for.cond.preheader
  %a.154 = phi i32 [ %a.057, %for.cond.preheader ], [ %add21, %for.body ]
  %i.053 = phi i32 [ 1, %for.cond.preheader ], [ %inc, %for.body ]
  %inc = add nsw i32 %i.053, 1
  %add2 = shl i32 %a.154, 1
  %add3 = add nsw i32 %add2, %i.053
  %add4 = shl i32 %add3, 1
  %add5 = add nsw i32 %add4, %i.053
  %add6 = shl i32 %add5, 1
  %add7 = add nsw i32 %add6, %i.053
  %add8 = shl i32 %add7, 1
  %add9 = add nsw i32 %add8, %i.053
  %add10 = shl i32 %add9, 1
  %add11 = add nsw i32 %add10, %i.053
  %add12 = shl i32 %add11, 1
  %add13 = add nsw i32 %add12, %i.053
  %add14 = shl i32 %add13, 1
  %add15 = add nsw i32 %add14, %i.053
  %add16 = shl i32 %add15, 1
  %add17 = add nsw i32 %add16, %i.053
  %add18 = shl i32 %add17, 1
  %add19 = add nsw i32 %add18, %i.053
  %add20 = shl i32 %add19, 1
  %add21 = add nsw i32 %add20, %i.053
  %exitcond = icmp eq i32 %inc, 1001
  br i1 %exitcond, label %while.cond.loopexit, label %for.body

while.end.loopexit:                               ; preds = %while.cond.loopexit
  %add21.lcssa.lcssa = phi i32 [ %add21.lcssa, %while.cond.loopexit ]
  br label %while.end

while.end:                                        ; preds = %while.end.loopexit, %entry
  %a.0.lcssa = phi i32 [ %add, %entry ], [ %add21.lcssa.lcssa, %while.end.loopexit ]
  tail call void @use_int(i32 %a.0.lcssa)
  ret void
}

declare void @use_int(i32)