1# RUN: llc -mtriple=i386-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32 2# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64 3 4--- | 5 6 define void @test_copy() { 7 ret void 8 } 9 10 define void @test_copy2() { 11 ret void 12 } 13 14 define void @test_copy3() { 15 ret void 16 } 17 18 define void @test_copy4() { 19 ret void 20 } 21 22 define void @test_copy5() { 23 ret void 24 } 25 26 define void @test_copy6() { 27 ret void 28 } 29 30... 31--- 32name: test_copy 33# ALL-LABEL: name: test_copy 34alignment: 4 35legalized: true 36regBankSelected: true 37# ALL: registers: 38# ALL-NEXT: - { id: 0, class: gr8, preferred-register: '' } 39# ALL-NEXT: - { id: 1, class: gr32, preferred-register: '' } 40registers: 41 - { id: 0, class: gpr, preferred-register: '' } 42 - { id: 1, class: gpr, preferred-register: '' } 43# ALL %0:gr8 = COPY $al 44# ALL-NEXT %1:gr32 = MOVZX32rr8 %0 45# ALL-NEXT $eax = COPY %1 46# ALL-NEXT RET 0, implicit $eax 47body: | 48 bb.1 (%ir-block.0): 49 liveins: $eax 50 51 %0(s8) = COPY $al 52 %1(s32) = G_ZEXT %0(s8) 53 $eax = COPY %1(s32) 54 RET 0, implicit $eax 55 56... 57--- 58name: test_copy2 59# ALL-LABEL: name: test_copy2 60alignment: 4 61legalized: true 62regBankSelected: true 63# ALL: registers: 64# ALL-NEXT: - { id: 0, class: gr8, preferred-register: '' } 65# ALL-NEXT: - { id: 1, class: gr32, preferred-register: '' } 66registers: 67 - { id: 0, class: gpr, preferred-register: '' } 68 - { id: 1, class: gpr, preferred-register: '' } 69# ALL: %0:gr8 = COPY $al 70# ALL-NEXT: %1:gr32 = MOVZX32rr8 %0 71# ALL-NEXT: $eax = COPY %1 72# ALL-NEXT: RET 0, implicit $eax 73body: | 74 bb.1 (%ir-block.0): 75 liveins: $eax 76 77 %0(s8) = COPY $al 78 %1(s32) = G_ZEXT %0(s8) 79 $eax = COPY %1(s32) 80 RET 0, implicit $eax 81 82... 83--- 84name: test_copy3 85# ALL-LABEL: name: test_copy3 86alignment: 4 87legalized: true 88regBankSelected: true 89# ALL: registers: 90# ALL-NEXT: - { id: 0, class: gr16[[ABCD:(_abcd)?]], preferred-register: '' } 91# ALL-NEXT: - { id: 1, class: gr8, preferred-register: '' } 92# ALL-NEXT: - { id: 2, class: gr32, preferred-register: '' } 93registers: 94 - { id: 0, class: gpr, preferred-register: '' } 95 - { id: 1, class: gpr, preferred-register: '' } 96 - { id: 2, class: gpr, preferred-register: '' } 97# ALL %0:gr16 = COPY $ax 98# ALL-NEXT %1:gr8 = COPY %0.sub_8bit 99# ALL-NEXT %2:gr32 = MOVZX32rr8 %1 100# ALL-NEXT $eax = COPY %2 101# ALL-NEXT RET 0, implicit $eax 102body: | 103 bb.1 (%ir-block.0): 104 liveins: $eax 105 106 %0(s16) = COPY $ax 107 %1(s8) = G_TRUNC %0(s16) 108 %2(s32) = G_ZEXT %1(s8) 109 $eax = COPY %2(s32) 110 RET 0, implicit $eax 111 112... 113--- 114name: test_copy4 115# ALL-LABEL: name: test_copy4 116alignment: 4 117legalized: true 118regBankSelected: true 119# ALL: registers: 120# ALL-NEXT: - { id: 0, class: gr32, preferred-register: '' } 121# ALL-NEXT: - { id: 1, class: gr16, preferred-register: '' } 122# ALL-NEXT: - { id: 2, class: gr32, preferred-register: '' } 123registers: 124 - { id: 0, class: gpr, preferred-register: '' } 125 - { id: 1, class: gpr, preferred-register: '' } 126 - { id: 2, class: gpr, preferred-register: '' } 127# ALL %0:gr32 = COPY $eax 128# ALL-NEXT %1:gr16 = COPY %0.sub_16bit 129# ALL-NEXT %2:gr32 = MOVZX32rr16 %1 130# ALL-NEXT $eax = COPY %2 131# ALL-NEXT RET 0, implicit $eax 132body: | 133 bb.1 (%ir-block.0): 134 liveins: $eax 135 136 %0(s32) = COPY $eax 137 %1(s16) = G_TRUNC %0(s32) 138 %2(s32) = G_ZEXT %1(s16) 139 $eax = COPY %2(s32) 140 RET 0, implicit $eax 141 142... 143--- 144name: test_copy5 145# ALL-LABEL: name: test_copy5 146alignment: 4 147legalized: true 148regBankSelected: true 149# ALL: registers: 150# ALL-NEXT: - { id: 0, class: gr32[[ABCD:(_abcd)?]], preferred-register: '' } 151# ALL-NEXT: - { id: 1, class: gr8, preferred-register: '' } 152# ALL-NEXT: - { id: 2, class: gr32, preferred-register: '' } 153registers: 154 - { id: 0, class: gpr, preferred-register: '' } 155 - { id: 1, class: gpr, preferred-register: '' } 156 - { id: 2, class: gpr, preferred-register: '' } 157# ALL %0:gr32[[ABCD]] = COPY $edx 158# ALL-NEXT %1:gr8 = COPY %0.sub_8bit 159# ALL-NEXT %2:gr32 = MOVZX32rr8 %1 160# ALL-NEXT $eax = COPY %2 161# ALL-NEXT RET 0, implicit $eax 162body: | 163 bb.1 (%ir-block.0): 164 liveins: $eax,$edx 165 166 %0(s32) = COPY $edx 167 %1(s8) = G_TRUNC %0(s32) 168 %2(s32) = G_ANYEXT %1(s8) 169 $eax = COPY %2(s32) 170 RET 0, implicit $eax 171 172... 173--- 174name: test_copy6 175# ALL-LABEL: name: test_copy6 176alignment: 4 177legalized: true 178regBankSelected: true 179# ALL: registers: 180# ALL-NEXT: - { id: 0, class: gr32, preferred-register: '' } 181# ALL-NEXT: - { id: 1, class: gr16, preferred-register: '' } 182# ALL-NEXT: - { id: 2, class: gr32, preferred-register: '' } 183registers: 184 - { id: 0, class: gpr, preferred-register: '' } 185 - { id: 1, class: gpr, preferred-register: '' } 186 - { id: 2, class: gpr, preferred-register: '' } 187# ALL %0:gr32 = COPY $edx 188# ALL-NEXT %1:gr16 = COPY %0.sub_16bit 189# ALL-NEXT %2:gr32 = SUBREG_TO_REG 0, %1, %subreg.sub_16bit 190# ALL-NEXT $eax = COPY %2 191# ALL-NEXT RET 0, implicit $eax 192body: | 193 bb.1 (%ir-block.0): 194 liveins: $eax,$edx 195 196 %0(s32) = COPY $edx 197 %1(s16) = G_TRUNC %0(s32) 198 %2(s32) = G_ANYEXT %1(s16) 199 $eax = COPY %2(s32) 200 RET 0, implicit $eax 201 202... 203 204