163 lines · plain
1# RUN: llc -mtriple=amdgcn -verify-machineinstrs -run-pass=register-coalescer,rename-independent-subregs -o - %s | FileCheck -check-prefix=GCN %s2# RUN: llc -mtriple=amdgcn -passes=register-coalescer,rename-independent-subregs -o - %s | FileCheck -check-prefix=GCN %s3---4 5# GCN-LABEL: name: mac_invalid_operands6# GCN: undef %18.sub0:vreg_128 = nofpexcept V_MAC_F32_e32 undef %3:vgpr_32, undef %9:vgpr_32, undef %18.sub0, implicit $mode, implicit $exec7 8name: mac_invalid_operands9alignment: 110exposesReturnsTwice: false11legalized: false12regBankSelected: false13selected: false14tracksRegLiveness: true15machineFunctionInfo:16 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'17 frameOffsetReg: '$sgpr4'18 19registers:20 - { id: 0, class: vreg_128 }21 - { id: 1, class: vreg_128 }22 - { id: 2, class: sgpr_64 }23 - { id: 3, class: vgpr_32 }24 - { id: 4, class: vgpr_32 }25 - { id: 5, class: vgpr_32 }26 - { id: 6, class: vgpr_32 }27 - { id: 7, class: sreg_64 }28 - { id: 8, class: vgpr_32 }29 - { id: 9, class: vgpr_32 }30 - { id: 10, class: vreg_64 }31 - { id: 11, class: vreg_64 }32 - { id: 12, class: vreg_128 }33 - { id: 13, class: vreg_128 }34 - { id: 14, class: vgpr_32 }35 - { id: 15, class: vreg_64 }36 - { id: 16, class: vgpr_32 }37 - { id: 17, class: vreg_128 }38body: |39 bb.0:40 successors: %bb.2, %bb.141 42 %7 = nofpexcept V_CMP_NEQ_F32_e64 0, 0, 0, undef %3, 0, implicit $mode, implicit $exec43 $vcc = COPY killed %744 S_CBRANCH_VCCZ %bb.2, implicit killed $vcc45 46 bb.1:47 successors: %bb.348 49 %4 = nofpexcept V_ADD_F32_e32 undef %6, undef %5, implicit $mode, implicit $exec50 undef %12.sub0 = COPY killed %451 %17 = COPY killed %1252 S_BRANCH %bb.353 54 bb.2:55 successors: %bb.356 57 %8 = nofpexcept V_MAC_F32_e32 undef %3, undef %9, undef %8, implicit $mode, implicit $exec58 undef %13.sub0 = COPY %859 %13.sub1 = COPY %860 %13.sub2 = COPY killed %861 %0 = COPY killed %1362 %17 = COPY killed %063 64 bb.3:65 %1 = COPY killed %1766 FLAT_STORE_DWORD undef %10, %1.sub2, 0, 0, implicit $exec, implicit $flat_scr67 %14 = COPY %1.sub168 %16 = COPY killed %1.sub069 undef %15.sub0 = COPY killed %1670 %15.sub1 = COPY killed %1471 FLAT_STORE_DWORDX2 undef %11, killed %15, 0, 0, implicit $exec, implicit $flat_scr72 S_ENDPGM 073 74...75---76# Make sure others uses after the mac are properly handled and not77# left unreplaced due to iterator issues from substituteRegister.78 79# GCN-LABEL: name: vreg_does_not_dominate80 81# GCN: undef %8.sub1:vreg_128 = nofpexcept V_MAC_F32_e32 undef %2:vgpr_32, undef %1:vgpr_32, undef %8.sub1, implicit $mode, implicit $exec82# GCN: undef %7.sub0:vreg_128 = V_MOV_B32_e32 0, implicit $exec83# GCN: undef %9.sub2:vreg_128 = COPY %7.sub084 85# GCN: undef %6.sub3:vreg_128 = nofpexcept V_ADD_F32_e32 undef %3:vgpr_32, undef %3:vgpr_32, implicit $mode, implicit $exec86# GCN: undef %7.sub0:vreg_128 = nofpexcept V_ADD_F32_e64 0, 0, 0, 0, 0, 0, implicit $mode, implicit $exec87# GCN: %8.sub1:vreg_128 = nofpexcept V_ADD_F32_e32 %8.sub1, %8.sub1, implicit $mode, implicit $exec88 89# GCN: BUFFER_STORE_DWORD_OFFEN %6.sub3, %0,90# GCN: BUFFER_STORE_DWORD_OFFEN %9.sub2, %0,91# GCN: BUFFER_STORE_DWORD_OFFEN %8.sub1, %0,92# GCN: BUFFER_STORE_DWORD_OFFEN %7.sub0, %0,93name: vreg_does_not_dominate94alignment: 195exposesReturnsTwice: false96legalized: false97regBankSelected: false98selected: false99tracksRegLiveness: true100machineFunctionInfo:101 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'102 frameOffsetReg: '$sgpr4'103registers:104 - { id: 0, class: vgpr_32, preferred-register: '' }105 - { id: 1, class: vgpr_32, preferred-register: '' }106 - { id: 2, class: vgpr_32, preferred-register: '' }107 - { id: 3, class: vgpr_32, preferred-register: '' }108 - { id: 4, class: vgpr_32, preferred-register: '' }109 - { id: 5, class: sreg_64, preferred-register: '' }110 - { id: 6, class: vreg_128, preferred-register: '' }111liveins:112 - { reg: '$vgpr0', virtual-reg: '%0' }113 - { reg: '$sgpr30_sgpr31', virtual-reg: '%5' }114body: |115 bb.0:116 successors: %bb.2, %bb.1117 liveins: $vgpr0, $sgpr30_sgpr31, $sgpr5118 119 %5 = COPY $sgpr30_sgpr31120 %0 = COPY $vgpr0121 undef %6.sub1 = nofpexcept V_MAC_F32_e32 undef %2, undef %1, undef %6.sub1, implicit $mode, implicit $exec122 %6.sub0 = V_MOV_B32_e32 0, implicit $exec123 %6.sub2 = COPY %6.sub0124 S_CBRANCH_VCCNZ %bb.2, implicit undef $vcc125 S_BRANCH %bb.1126 127 bb.1:128 successors: %bb.2129 130 %6.sub3 = nofpexcept V_ADD_F32_e32 undef %3, undef %3, implicit $mode, implicit $exec131 %6.sub0 = nofpexcept V_ADD_F32_e64 0, 0, 0, 0, 0, 0, implicit $mode, implicit $exec132 %6.sub1 = nofpexcept V_ADD_F32_e32 %6.sub1, %6.sub1, implicit $mode, implicit $exec133 %6.sub2 = COPY %6.sub0134 135 bb.2:136 BUFFER_STORE_DWORD_OFFEN %6.sub3, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 12, 0, 0, implicit $exec137 BUFFER_STORE_DWORD_OFFEN %6.sub2, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 8, 0, 0, implicit $exec138 BUFFER_STORE_DWORD_OFFEN %6.sub1, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec139 BUFFER_STORE_DWORD_OFFEN %6.sub0, %0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec140 $sgpr30_sgpr31 = COPY %5141 S_SETPC_B64_return $sgpr30_sgpr31142 143...144 145# GCN-LABEL: name: inf_loop_tied_operand146# GCN: bb.0:147# GCN-NEXT: undef %2.sub0:vreg_128 = nofpexcept V_MAC_F32_e32 1073741824, undef %0:vgpr_32, undef %2.sub0, implicit $mode, implicit $exec148# GCN-NEXT: dead undef %3.sub1:vreg_128 = COPY %2.sub0149 150name: inf_loop_tied_operand151tracksRegLiveness: true152registers:153 - { id: 0, class: vgpr_32, preferred-register: '' }154 - { id: 1, class: vgpr_32, preferred-register: '' }155 - { id: 2, class: vreg_128, preferred-register: '' }156body: |157 bb.0:158 %1 = nofpexcept V_MAC_F32_e32 1073741824, undef %0, undef %1, implicit $mode, implicit $exec159 undef %2.sub0 = COPY %1160 %2.sub1 = COPY %1161 162...163