1 # RUN: llc -mtriple=powerpc64le-linux-gnu -stop-after ppc-pre-emit-peephole %s -o - -verify-machineinstrs | FileCheck %s
5 # The cmp instr is optimized with the record form.
6 tracksRegLiveness: true
9 successors: %bb.1(0x30000000), %bb.2(0x50000000)
11 renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
12 renamable $cr0 = CMPDI renamable $x3, 0, implicit killed $x3
13 ; CHECK-LABEL: name: test1
14 ; CHECK: renamable $x3 = OR8_rec renamable $x3, killed renamable $x4, implicit-def $cr0
16 BCC 68, killed renamable $cr0, %bb.2
20 BLR8 implicit $lr8, implicit $rm, implicit $x3
24 BLR8 implicit $lr8, implicit $rm, implicit $x3
29 # The imm of the comparison instr isn't 0.
30 tracksRegLiveness: true
33 successors: %bb.1(0x30000000), %bb.2(0x50000000)
35 renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
36 renamable $cr0 = CMPDI renamable $x3, 2, implicit killed $x3
37 ; CHECK-LABEL: name: test2
39 BCC 68, killed renamable $cr0, %bb.2
43 BLR8 implicit $lr8, implicit $rm, implicit $x3
47 BLR8 implicit $lr8, implicit $rm, implicit $x3
52 # The comparison instr has a implicit def.
53 tracksRegLiveness: true
56 successors: %bb.1(0x30000000), %bb.2(0x50000000)
58 renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
59 renamable $cr0 = CMPDI renamable $x3, 0, implicit-def $x3
60 ; CHECK-LABEL: name: test3
62 BCC 68, killed renamable $cr0, %bb.2
66 BLR8 implicit $lr8, implicit $rm, implicit $x3
70 BLR8 implicit $lr8, implicit $rm, implicit $x3
75 # There is another use for cr0 between OR8 instr and CMPWI instr.
76 tracksRegLiveness: true
79 successors: %bb.1(0x30000000), %bb.2(0x50000000)
80 liveins: $x3, $x4, $cr0
81 renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
82 renamable $cr1 = MCRF killed $cr0, implicit $x3
83 renamable $cr0 = CMPDI renamable $x3, 0, implicit killed $x3, implicit $cr1
84 ; CHECK-LABEL: name: test4
86 BCC 68, killed renamable $cr0, %bb.2
90 BLR8 implicit $lr8, implicit $rm, implicit $x3
94 BLR8 implicit $lr8, implicit $rm, implicit $x3
99 # There is another def for cr0 between OR8 instr and CMPWI instr.
100 tracksRegLiveness: true
103 successors: %bb.1(0x30000000), %bb.2(0x50000000)
105 renamable $x3 = OR8 killed renamable $x3, renamable $x4
106 renamable $cr1 = CMPD renamable $x3, renamable $x4, implicit-def $cr0
107 renamable $cr0 = CMPDI renamable $x3, 0, implicit killed $x3, implicit $cr1
108 ; CHECK-LABEL: name: test5
110 BCC 68, killed renamable $cr0, %bb.2
114 BLR8 implicit $lr8, implicit $rm, implicit $x3
118 BLR8 implicit $lr8, implicit $rm, implicit $x3
123 # The SrcReg isn't CR0.
124 tracksRegLiveness: true
127 successors: %bb.1(0x30000000), %bb.2(0x50000000)
129 renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
130 renamable $cr1 = CMPDI renamable $x3, 0, implicit killed $x3
131 ; CHECK-LABEL: name: test6
133 BCC 68, killed renamable $cr1, %bb.2
137 BLR8 implicit $lr8, implicit $rm, implicit $x3
141 BLR8 implicit $lr8, implicit $rm, implicit $x3