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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
# RUN: llc -mtriple=powerpc64le-linux-gnu -stop-after ppc-pre-emit-peephole %s -o - -verify-machineinstrs | FileCheck %s
---
name: test1
# The cmp instr is optimized with the record form.
tracksRegLiveness: true
body: |
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $x3, $x4
renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
renamable $cr0 = CMPDI renamable $x3, 0, implicit killed $x3
; CHECK-LABEL: name: test1
; CHECK: renamable $x3 = OR8_rec killed renamable $x3, killed renamable $x4, implicit-def $cr0
; CHECK-NOT: CMPDI
BCC 68, killed renamable $cr0, %bb.2
bb.1:
$x3 = LI8 102
BLR8 implicit $lr8, implicit $rm, implicit $x3
bb.2:
$x3 = LI8 116
BLR8 implicit $lr8, implicit $rm, implicit $x3
...
---
name: test2
# The imm of the comparison instr isn't 0.
tracksRegLiveness: true
body: |
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $x3, $x4
renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
renamable $cr0 = CMPDI renamable $x3, 2, implicit killed $x3
; CHECK-LABEL: name: test2
; CHECK: CMPDI
BCC 68, killed renamable $cr0, %bb.2
bb.1:
$x3 = LI8 102
BLR8 implicit $lr8, implicit $rm, implicit $x3
bb.2:
$x3 = LI8 116
BLR8 implicit $lr8, implicit $rm, implicit $x3
...
---
name: test3
# The comparison instr has a implicit def.
tracksRegLiveness: true
body: |
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $x3, $x4
renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
renamable $cr0 = CMPDI renamable $x3, 0, implicit-def $x3
; CHECK-LABEL: name: test3
; CHECK: CMPDI
BCC 68, killed renamable $cr0, %bb.2
bb.1:
$x3 = LI8 102
BLR8 implicit $lr8, implicit $rm, implicit $x3
bb.2:
$x3 = LI8 116
BLR8 implicit $lr8, implicit $rm, implicit $x3
...
---
name: test4
# There is another use for cr0 between OR8 instr and CMPWI instr.
tracksRegLiveness: true
body: |
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $x3, $x4, $cr0
renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
renamable $cr1 = MCRF killed $cr0, implicit $x3
renamable $cr0 = CMPDI renamable $x3, 0, implicit killed $x3, implicit $cr1
; CHECK-LABEL: name: test4
; CHECK: CMPDI
BCC 68, killed renamable $cr0, %bb.2
bb.1:
$x3 = LI8 102
BLR8 implicit $lr8, implicit $rm, implicit $x3
bb.2:
$x3 = LI8 116
BLR8 implicit $lr8, implicit $rm, implicit $x3
...
---
name: test5
# There is another def for cr0 between OR8 instr and CMPWI instr.
tracksRegLiveness: true
body: |
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $x3, $x4
renamable $x3 = OR8 killed renamable $x3, renamable $x4
renamable $cr1 = CMPD renamable $x3, renamable $x4, implicit-def $cr0
renamable $cr0 = CMPDI renamable $x3, 0, implicit killed $x3, implicit $cr1
; CHECK-LABEL: name: test5
; CHECK: CMPDI
BCC 68, killed renamable $cr0, %bb.2
bb.1:
$x3 = LI8 102
BLR8 implicit $lr8, implicit $rm, implicit $x3
bb.2:
$x3 = LI8 116
BLR8 implicit $lr8, implicit $rm, implicit $x3
...
---
name: test6
# The SrcReg isn't CR0.
tracksRegLiveness: true
body: |
bb.0.entry:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $x3, $x4
renamable $x3 = OR8 killed renamable $x3, killed renamable $x4
renamable $cr1 = CMPDI renamable $x3, 0, implicit killed $x3
; CHECK-LABEL: name: test6
; CHECK: CMPDI
BCC 68, killed renamable $cr1, %bb.2
bb.1:
$x3 = LI8 102
BLR8 implicit $lr8, implicit $rm, implicit $x3
bb.2:
$x3 = LI8 116
BLR8 implicit $lr8, implicit $rm, implicit $x3
...
|