File: undef-order.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (53 lines) | stat: -rw-r--r-- 1,243 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
;RUN: opt -mem2reg -S < %s | FileCheck %s

declare i1 @cond()

define i32 @foo() {
Entry:
    %val = alloca i32
    %c1 = call i1 @cond()
    br i1 %c1, label %Store1, label %Store2
Block1:
    br label %Join
Block2:
    br label %Join
Block3:
    br label %Join
Block4:
    br label %Join
Block5:
    br label %Join
Store1:
    store i32 1, i32* %val
    br label %Join
Block6:
    br label %Join
Block7:
    br label %Join
Block8:
    br label %Join
Block9:
    br label %Join
Block10:
    br label %Join
Store2:
    store i32 2, i32* %val
    br label %Join
Block11:
    br label %Join
Block12:
    br label %Join
Block13:
    br label %Join
Block14:
    br label %Join
Block15:
    br label %Join
Block16:
    br label %Join
Join:
; Phi inserted here should have operands appended deterministically
; CHECK: %val.0 = phi i32 [ 1, %Store1 ], [ 2, %Store2 ], [ undef, %Block1 ], [ undef, %Block2 ], [ undef, %Block3 ], [ undef, %Block4 ], [ undef, %Block5 ], [ undef, %Block6 ], [ undef, %Block7 ], [ undef, %Block8 ], [ undef, %Block9 ], [ undef, %Block10 ], [ undef, %Block11 ], [ undef, %Block12 ], [ undef, %Block13 ], [ undef, %Block14 ], [ undef, %Block15 ], [ undef, %Block16 ]
    %result = load i32, i32* %val
    ret i32 %result
}