1 # RUN: llc -mtriple=x86_64-- -run-pass branch-folder -O3 -o - %s | FileCheck %s
6 ; CHECK-LABEL: name: test1a
8 ; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
9 ; CHECK: JCC_1 %bb.2, 5, implicit $eflags
11 ; CHECK: successors: %bb.2(0x80000000)
12 ; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
15 ; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
18 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
19 JCC_1 %bb.2, 5, implicit killed $eflags
22 MOV8mi $r12, 1, $noreg, 0, $noreg, 0
23 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
27 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
35 ; Verify that we get the same rewrites as in test1a when adding some
36 ; DBG_VALUE instructions in the mix.
38 ; CHECK-LABEL: name: test1b
40 ; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
41 ; CHECK: JCC_1 %bb.2, 5, implicit $eflags
43 ; CHECK: successors: %bb.2(0x80000000)
44 ; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
49 ; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
52 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
53 JCC_1 %bb.2, 5, implicit killed $eflags
56 MOV8mi $r12, 1, $noreg, 0, $noreg, 0
57 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
63 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
70 ; CFI instruction currently prevents the rewrite here (although technically
71 ; I suppose that branch folding could let bb.1 fallthrough into bb.2 here).
73 ; CHECK-LABEL: name: test2a
75 ; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
76 ; CHECK: JCC_1 %bb.2, 5, implicit killed $eflags
78 ; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
79 ; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
82 ; CHECK: CFI_INSTRUCTION def_cfa_offset 8
83 ; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
86 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
87 JCC_1 %bb.2, 5, implicit killed $eflags
90 MOV8mi $r12, 1, $noreg, 0, $noreg, 0
91 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
95 CFI_INSTRUCTION def_cfa_offset 8
96 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
103 ; Verify that we get the same rewrites as in test1a when adding some
104 ; DBG_VALUE instructions in the mix.
106 ; CHECK-LABEL: name: test2b
108 ; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
109 ; CHECK: JCC_1 %bb.2, 5, implicit killed $eflags
111 ; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
112 ; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
116 ; CHECK: CFI_INSTRUCTION def_cfa_offset 8
118 ; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
121 TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
122 JCC_1 %bb.2, 5, implicit killed $eflags
125 MOV8mi $r12, 1, $noreg, 0, $noreg, 0
126 MOV8mi $r13, 1, $noreg, 0, $noreg, 0
131 CFI_INSTRUCTION def_cfa_offset 8
133 MOV8mi $r13, 1, $noreg, 0, $noreg, 0