1 # RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -verify-machineinstrs \
2 # RUN: -run-pass ppc-mi-peepholes -ppc-convert-rr-to-ri %s -o - | FileCheck %s
5 name: foldNewDformStore
6 # CHECK: name: foldNewDformStore
7 tracksRegLiveness: true
12 %0:g8rc_and_g8rc_nox0 = COPY $x3
13 %1:g8rc_and_g8rc_nox0 = ADDI8 %0:g8rc_and_g8rc_nox0, 144
15 ; CHECK: STD killed %2, 160, %0
16 STD killed %2:g8rc, 16, %1:g8rc_and_g8rc_nox0
17 BLR8 implicit $lr8, implicit $rm
20 name: foldNewDformStoreAlignNotMatch
21 # CHECK: name: foldNewDformStoreAlignNotMatch
22 tracksRegLiveness: true
27 %0:g8rc_and_g8rc_nox0 = COPY $x3
28 %1:g8rc_and_g8rc_nox0 = ADDI8 %0:g8rc_and_g8rc_nox0, 141
30 ; CHECK: STD killed %2, 16, %1
31 STD killed %2:g8rc, 16, %1:g8rc_and_g8rc_nox0
32 BLR8 implicit $lr8, implicit $rm
35 name: foldNewDformStoreKilledFlag
36 # CHECK: name: foldNewDformStoreKilledFlag
37 tracksRegLiveness: true
42 %0:g8rc_and_g8rc_nox0 = COPY $x3
43 %1:g8rc_and_g8rc_nox0 = ADDI8 %0:g8rc_and_g8rc_nox0, 144
45 ; CHECK: STD %1, 0, %0
46 STD %1:g8rc_and_g8rc_nox0, 0, killed %0:g8rc_and_g8rc_nox0
47 ; CHECK: STD killed %2, 160, killed %0
48 STD killed %2:g8rc, 16, %1:g8rc_and_g8rc_nox0
49 BLR8 implicit $lr8, implicit $rm
52 name: foldNewDformPreferLIOperand
53 # CHECK: name: foldNewDformPreferLIOperand
54 tracksRegLiveness: true
58 %0:g8rc_and_g8rc_nox0 = COPY $x3
59 %1:g8rc = ADDI8 %0:g8rc_and_g8rc_nox0, 1
61 ; CHECK: SUBFIC8 killed %1, 1, implicit-def $carry
62 %3:g8rc = SUBFC8 killed %1:g8rc, %2:g8rc, implicit-def $carry
63 %4:g8rc = SUBFE8 %2:g8rc, %2:g8rc, implicit-def dead $carry, implicit $carry
64 %5:g8rc = NEG8 killed %4:g8rc
66 BLR8 implicit $lr8, implicit $rm, implicit $x3
69 name: killFlagSameBlock
70 #CHECK : name : killFlagSameBlock
71 tracksRegLiveness: true
75 %0:g8rc_and_g8rc_nox0 = COPY $x3
76 %1:g8rc_and_g8rc_nox0 = ADDI8 killed %0:g8rc_and_g8rc_nox0, -8
77 ; CHECK: %1:g8rc_and_g8rc_nox0 = ADDI8 %0, -8
79 ; CHECK: STD killed %2, 8, killed %0
80 STD killed %2:g8rc, 16, %1:g8rc_and_g8rc_nox0
81 BLR8 implicit $lr8, implicit $rm
84 name: killFlagDifferentBlocks
85 #CHECK : name : killFlagDifferentBlocks
86 tracksRegLiveness: true
90 %0:g8rc_and_g8rc_nox0 = COPY $x3
91 ; CHECK: %1:g8rc_and_g8rc_nox0 = ADDI8 %0, -8
92 %1:g8rc_and_g8rc_nox0 = ADDI8 killed %0:g8rc_and_g8rc_nox0, -8
96 ; CHECK: STD killed %2, 8, killed %0
97 STD killed %2:g8rc, 16, %1:g8rc_and_g8rc_nox0
98 BLR8 implicit $lr8, implicit $rm