File: ordering.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (79 lines) | stat: -rw-r--r-- 2,281 bytes parent folder | download | duplicates (4)
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
71
72
73
74
75
76
77
78
79
; REQUIRES: assert-but-this-is-misspelled-and-should-say-asserts-but-then-the-test-case-will-fail
; RUN: opt -passes=print-predicateinfo -debug < %s 2>&1 | FileCheck %s

declare void @use(i32)

; Make sure we are visiting the values to build predicate infos for in a
; deterministic order.
define i32 @test12(i32 %x, i32 %y) {
; CHECK: Visiting i32 %x
; CHECK: Visiting i32 %y
; CHECK: Visiting   %lcmp = icmp eq i32 %x, 0
; CHECK: Visiting   %lcmp2 = icmp slt i32 %y, 1000
; CHECK: Visiting   %lcmp3 = icmp slt i32 %y.0, 900
; CHECK: Visiting   %lcmp4 = icmp slt i32 %y.0.1, 700
; CHECK: Visiting   %lcmp5 = icmp slt i32 %y.0.1.2, 700
; CHECK: Visiting   %lcmp6 = icmp slt i32 %y.0.1.2.3, 700
; CHECK: Visiting   %lcmp7 = icmp slt i32 %y.0.1.2.3.4, 700
; CHECK: Visiting   %rcmp = icmp eq i32 %x, 0
entry:
  br i1 undef, label %left, label %right

left:
  %lcmp = icmp eq i32 %x, 0
  br i1 %lcmp, label %left_cond_true, label %left_cond_false

left_cond_true:
  %lcmp2 = icmp slt i32 %y, 1000
  br i1 %lcmp2, label %left_cond_true2, label %left_ret

left_cond_true2:
  call void @use(i32 %y)
  %lcmp3 = icmp slt i32 %y, 900
  br i1 %lcmp3, label %left_cond_true3, label %left_ret

left_cond_true3:
  call void @use(i32 %y)
  %lcmp4 = icmp slt i32 %y, 700
  br i1 %lcmp4, label %left_cond_true4, label %left_ret

left_cond_true4:
  call void @use(i32 %y)
  %lcmp5 = icmp slt i32 %y, 700
  br i1 %lcmp5, label %left_cond_true5, label %left_ret

left_cond_true5:
  call void @use(i32 %y)
  %lcmp6 = icmp slt i32 %y, 700
  br i1 %lcmp6, label %left_cond_true6, label %left_ret

left_cond_true6:
  call void @use(i32 %y)
  %lcmp7 = icmp slt i32 %y, 700
  br i1 %lcmp7, label %left_cond_true7, label %left_ret

left_cond_true7:
  ret i32 %y

left_cond_false:
  br label %left_ret

left_ret:
  %lres = phi i32 [ %x, %left_cond_true ], [ %x, %left_cond_false ], [ %x, %left_cond_true2 ], [ %x, %left_cond_true3 ], [ %x, %left_cond_true4 ], [ %x, %left_cond_true5 ], [ %x, %left_cond_true6 ]

  ret i32 %lres

right:
  %rcmp = icmp eq i32 %x, 0
  br i1 %rcmp, label %right_cond_true, label %right_cond_false

right_cond_true:
  br label %right_ret

right_cond_false:
  br label %right_ret

right_ret:
  %rres = phi i32 [ %x, %right_cond_true ], [ %x, %right_cond_false ]
  ret i32 %rres
}