• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple=i686-unknown-unknown -run-pass=x86-flags-copy-lowering \
2# RUN:  -print-after=x86-flags-copy-lowering %s -o - | FileCheck %s
3#
4# Check that $eflags is removed from live-in lists of successor blocks.
5#
6# CHECK-NOT: liveins: $eflags
7
8--- |
9  define void @fun(i16 %arg, i64 %arg1, i8 %arg2, i8* %arg3, i32 %arg4) { ret void}
10...
11---
12name:            fun
13alignment:       16
14tracksRegLiveness: true
15registers:
16  - { id: 0, class: gr16 }
17  - { id: 1, class: gr16 }
18  - { id: 2, class: gr16 }
19  - { id: 3, class: gr32 }
20  - { id: 4, class: gr32 }
21  - { id: 5, class: gr8 }
22  - { id: 6, class: gr32 }
23  - { id: 7, class: gr32 }
24  - { id: 8, class: gr32 }
25  - { id: 9, class: gr32 }
26  - { id: 10, class: gr32 }
27  - { id: 11, class: gr32 }
28  - { id: 12, class: gr32 }
29  - { id: 13, class: gr8 }
30  - { id: 14, class: gr32 }
31  - { id: 15, class: gr32 }
32  - { id: 16, class: gr32_abcd }
33  - { id: 17, class: gr8 }
34  - { id: 18, class: gr8 }
35  - { id: 19, class: gr32 }
36  - { id: 20, class: gr32 }
37frameInfo:
38  maxAlignment:    4
39fixedStack:
40  - { id: 0, offset: 20, size: 4, alignment: 4, isImmutable: true }
41  - { id: 1, offset: 16, size: 4, alignment: 4, isImmutable: true }
42  - { id: 2, offset: 12, size: 1, alignment: 4, isImmutable: true }
43  - { id: 3, offset: 8, size: 4, alignment: 4, isImmutable: true }
44  - { id: 4, offset: 4, size: 4, alignment: 4, isImmutable: true }
45  - { id: 5, size: 2, alignment: 4, isImmutable: true }
46machineFunctionInfo: {}
47body:             |
48  bb.0:
49    %4:gr32 = MOV32rm %fixed-stack.3, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.3)
50    %3:gr32 = MOV32rm %fixed-stack.4, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.4)
51    %7:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.0)
52    %6:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.1)
53    %5:gr8 = MOV8rm %fixed-stack.2, 1, $noreg, 0, $noreg :: (load 1 from %fixed-stack.2, align 4)
54    %9:gr32 = IMPLICIT_DEF
55    %11:gr32 = IMPLICIT_DEF
56
57  bb.1:
58    successors: %bb.2, %bb.3
59
60    CMP32rr %3, %9, implicit-def $eflags
61    %10:gr32 = SBB32rr %4, %11, implicit-def $eflags, implicit $eflags
62    %12:gr32 = COPY $eflags
63    %13:gr8 = SETCCr 12, implicit $eflags
64    %14:gr32 = MOVZX32rr8 killed %13
65    %15:gr32 = NEG32r %14, implicit-def dead $eflags
66    %16:gr32_abcd = MOV32r0 implicit-def dead $eflags
67    $eflags = COPY %12
68    %17:gr8 = COPY %16.sub_8bit
69    JCC_1 %bb.3, 12, implicit $eflags
70
71  bb.2:
72    liveins: $eflags
73
74
75  bb.3:
76    successors: %bb.4, %bb.5
77    liveins: $eflags
78
79    %18:gr8 = PHI %5, %bb.2, %17, %bb.1
80    MOV8mr %6, 1, $noreg, 0, $noreg, killed %18 :: (volatile store 1 into %ir.arg3)
81    JCC_1 %bb.5, 12, implicit $eflags
82
83  bb.4:
84
85  bb.5:
86    %19:gr32 = PHI %16, %bb.4, %15, %bb.3
87    $eax = COPY %7
88    CDQ implicit-def $eax, implicit-def $edx, implicit $eax
89    IDIV32r killed %19, implicit-def dead $eax, implicit-def $edx, implicit-def dead $eflags, implicit $eax, implicit $edx
90    JMP_1 %bb.1
91
92...
93