1# RUN: llc -mtriple=powerpc64le--linux-gnu -stop-after ppc-pre-emit-peephole %s -o - -verify-machineinstrs | FileCheck %s 2 3--- 4# LI + XFORM -> DFORM, no killed/dead flag fixup. 5name: testKillPassUpLI1 6#CHECK: name: testKillPassUpLI1 7tracksRegLiveness: true 8body: | 9 bb.0.entry: 10 liveins: $x3, $f1, $x5 11 $x3 = LI8 100 12 STFSX killed $f1, $x3, $x5 13 ; CHECK: STFS killed $f1, 100, $x5 14 STD killed $x3, killed $x5, 100 15 ; CHECK: STD killed $x3, killed $x5, 100 16 BLR8 implicit $lr8, implicit $rm 17 18... 19--- 20# LI + XFORM -> DFORM, fixup killed/dead flag for $x3, find no use, set def as 21# dead(LI8 is deleted). 22name: testKillPassUpLI2 23# CHECK: name: testKillPassUpLI2 24tracksRegLiveness: true 25body: | 26 bb.0.entry: 27 liveins: $x3, $f1, $x5 28 $x3 = LI8 100 29 ; CHECK-NOT: LI8 30 STFSX killed $f1, killed $x3, killed $x5 31 ; CHECK: STFS killed $f1, 100, killed $x5 32 BLR8 implicit $lr8, implicit $rm 33 34... 35--- 36# LI + XFORM -> DFORM, fixup killed/dead flag for $x3, find last use, set last 37# use as killed. 38name: testKillPassUpLI3 39# CHECK: name: testKillPassUpLI3 40tracksRegLiveness: true 41body: | 42 bb.0.entry: 43 liveins: $x3, $f1, $x5 44 $x3 = LI8 100 45 STD $x3, $x5, 100 46 ; CHECK: STD killed $x3, $x5, 100 47 STFSX killed $f1, killed $x3, $x5 48 ; CHECK: STFS killed $f1, 100, $x5 49 STD killed $x5, $x5, 100 50 ; CHECK: STD killed $x5, $x5, 100 51 BLR8 implicit $lr8, implicit $rm 52 53... 54--- 55# LI + OP -> LI, fixup killed/dead flag for $x3, find last use, set last use as 56# killed. 57name: testKillPassUpLI4 58# CHECK: name: testKillPassUpLI4 59tracksRegLiveness: true 60body: | 61 bb.0.entry: 62 liveins: $x3, $x5 63 $x3 = LI8 100 64 STD $x3, $x5, 100 65 ; CHECK: STD killed $x3, killed $x5, 100 66 $x5 = ADDI8 killed $x3, 200 67 ; CHECK: $x5 = LI8 300 68 STD $x5, $x5, 100 69 BLR8 implicit $lr8, implicit $rm 70 71... 72--- 73# ADD + XFORM -> DFORM, fixup killed/dead flag for $x3, find no use, set def as dead 74# (ADDI8 is deleted). 75name: testKillPassUpADD1 76# CHECK: name: testKillPassUpADD1 77tracksRegLiveness: true 78body: | 79 bb.0.entry: 80 liveins: $x3, $f1, $x5 81 $x3 = ADDI8 killed $x5, 100 82 ; CHECK-NOT: ADDI8 83 STFSX killed $f1, $zero8, killed $x3 84 ; CHECK: STFS killed $f1, 100, killed $x5 85 BLR8 implicit $lr8, implicit $rm 86 87... 88--- 89# ADD + XFORM -> DFORM, fixup killed/dead flag for $x3, find last use, set last 90# use as killed. 91name: testKillPassUpADD2 92# CHECK: name: testKillPassUpADD2 93tracksRegLiveness: true 94body: | 95 bb.0.entry: 96 liveins: $x3, $f1, $x5 97 $x3 = ADDI8 $x5, 100 98 STD $x3, $x5, 100 99 ; CHECK: STD killed $x3, $x5, 100 100 STFSX killed $f1, $zero8, killed $x3 101 ; CHECK: STFS killed $f1, 100, $x5 102 STD killed $x5, $x5, 100 103 ; CHECK: STD killed $x5, $x5, 100 104 BLR8 implicit $lr8, implicit $rm 105 106... 107--- 108# ADD + XFORM -> DFORM, fixup killed/dead flag for register $x5, DFORM 109# instruction uses $x5 and no other kill uses, set it as killed in 110# DFORM instruction. 111name: testKillPassDownADD1 112# CHECK: name: testKillPassDownADD1 113tracksRegLiveness: true 114body: | 115 bb.0.entry: 116 liveins: $x3, $f1, $x5 117 $x3 = ADDI8 killed $x5, 100 118 ; CHECK: $x3 = ADDI8 $x5, 100 119 STFSX killed $f1, $zero8, $x3 120 ; CHECK: STFS killed $f1, 100, killed $x5 121 STD killed $x3, $x3, 100 122 ; CHECK: STD killed $x3, $x3, 100 123 BLR8 implicit $lr8, implicit $rm 124 125... 126--- 127# ADD + XFORM -> DFORM, fixup killed/dead flag for register $x5, DFORM 128# instruction uses $x5 and there is one kill use, set $x5 as killed in 129# DFORM instruction and clear the other kill use killed flag. 130name: testKillPassDownADD2 131# CHECK: name: testKillPassDownADD2 132tracksRegLiveness: true 133body: | 134 bb.0.entry: 135 liveins: $x3, $f1, $x5 136 $x3 = ADDI8 $x5, 100 137 STD killed $x5, $x5, 100 138 ; CHECK: STD $x5, $x5, 100 139 STFSX killed $f1, $zero8, killed $x3 140 ; CHECK: STFS killed $f1, 100, killed $x5 141 BLR8 implicit $lr8, implicit $rm 142 143... 144--- 145# ADD + XFORM -> DFORM, fixup killed/dead flag for register $x3, DFORM 146# instruction defines $x3, do nothing for killed/dead flag. 147name: testKillPassDownADD3 148# CHECK: name: testKillPassDownADD3 149tracksRegLiveness: true 150body: | 151 bb.0.entry: 152 liveins: $x3, $x5 153 $x3 = ADDI8 $x5, 100 154 $x3 = LDX $zero8, killed $x3 155 ; CHECK: $x3 = LD 100, $x5 156 STD killed $x5, $x5, 100 157 ; CHECK: STD killed $x5, $x5, 100 158 STD killed $x3, $x3, 200 159 ; CHECK: STD killed $x3, $x3, 200 160 BLR8 implicit $lr8, implicit $rm 161 162... 163--- 164# ADD + XFORM -> DFORM, fixup killed/dead flag for both register $x5 and $x3, 165# DFORM instruction uses $x5 and there is one kill use, set $x5 as killed in 166# DFORM instruction and clear the other kill use killed flag. Find last use for 167# $x3, set last use as killed. 168name: testKillPassDownADD4 169# CHECK: name: testKillPassDownADD4 170tracksRegLiveness: true 171body: | 172 bb.0.entry: 173 liveins: $x3, $f1, $x5 174 $x3 = ADDI8 $x5, 100 175 STD killed $x5, $x5, 100 176 ; CHECK: STD $x5, $x5, 100 177 STD $x3, $x3, 200 178 ; CHECK: STD killed $x3, $x3, 200 179 STFSX killed $f1, $zero8, killed $x3 180 ; CHECK: STFS killed $f1, 100, killed $x5 181 BLR8 implicit $lr8, implicit $rm 182 183... 184