File: range-signedness.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (62 lines) | stat: -rw-r--r-- 2,382 bytes parent folder | download | duplicates (2)
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
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s

define void @x(ptr %cond) {
; CHECK-LABEL: 'x'
; CHECK-NEXT:  Classifying expressions for: @x
; CHECK-NEXT:    %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
; CHECK-NEXT:    --> {0,+,1}<nuw><nsw><%loop> U: [0,-128) S: [0,-128) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
; CHECK-NEXT:    %idx.inc = add nsw i8 %idx, 1
; CHECK-NEXT:    --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
; CHECK-NEXT:    %c = load volatile i1, ptr %cond, align 1
; CHECK-NEXT:    --> %c U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
; CHECK-NEXT:  Determining loop execution counts for: @x
; CHECK-NEXT:  Loop %loop: Unpredictable backedge-taken count.
; CHECK-NEXT:  Loop %loop: Unpredictable constant max backedge-taken count.
; CHECK-NEXT:  Loop %loop: Unpredictable symbolic max backedge-taken count.
; CHECK-NEXT:  Loop %loop: Unpredictable predicated backedge-taken count.
;
  entry:
  br label %loop

  loop:
  %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]

  %idx.inc = add nsw i8 %idx, 1

  %c = load volatile i1, ptr %cond
  br i1 %c, label %loop, label %exit

  exit:
  ret void
}

define void @y(ptr %addr) {
; CHECK-LABEL: 'y'
; CHECK-NEXT:  Classifying expressions for: @y
; CHECK-NEXT:    %idx = phi i8 [ -5, %entry ], [ %idx.inc, %loop ]
; CHECK-NEXT:    --> {-5,+,1}<nsw><%loop> U: [-5,6) S: [-5,6) Exits: 5 LoopDispositions: { %loop: Computable }
; CHECK-NEXT:    %idx.inc = add i8 %idx, 1
; CHECK-NEXT:    --> {-4,+,1}<nsw><%loop> U: [-4,7) S: [-4,7) Exits: 6 LoopDispositions: { %loop: Computable }
; CHECK-NEXT:  Determining loop execution counts for: @y
; CHECK-NEXT:  Loop %loop: backedge-taken count is 10
; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is 10
; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is 10
; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is 10
; CHECK-NEXT:   Predicates:
; CHECK:       Loop %loop: Trip multiple is 11
;
  entry:
  br label %loop

  loop:
  %idx = phi i8 [-5, %entry ], [ %idx.inc, %loop ]

  %idx.inc = add i8 %idx, 1

  %continue = icmp slt i8 %idx.inc, 6
  br i1 %continue, label %loop, label %exit

  exit:
  ret void
}