brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 0082882 Raw
97 lines · plain
1# RUN: llc -mtriple amdgcn -run-pass livevars -run-pass phi-node-elimination -o - %s | FileCheck %s2# RUN: llc -mtriple amdgcn --passes='require<live-vars>,phi-node-elimination' -o - %s | FileCheck %s3 4################################################################################5# This test used to hit an assert in PHIElimination:6#  PHIElimination::LowerPHINode(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator): Assertion `KillInst->readsRegister(SrcReg) && "Cannot find kill instruction"'7 8---9name:            foo10tracksRegLiveness: true11body:             |12  bb.0:13    S_CBRANCH_SCC0 %bb.2, implicit undef $scc14 15  bb.1:16    %1:sreg_32_xm0 = S_MOV_B32 25517    S_BRANCH %bb.318 19  bb.2:20    %2:sreg_32_xm0 = S_MOV_B32 25421 22  bb.3:23    dead %3:sreg_32_xm0 = PHI undef %2, %bb.2, undef %1, %bb.124    %4:sreg_32_xm0 = PHI %2, %bb.2, %1, %bb.125    S_NOP 0, implicit %426...27 28# CHECK-LABEL: name:            foo29# CHECK:   bb.3:30# CHECK-NEXT:     dead %2:sreg_32_xm0 = IMPLICIT_DEF31# CHECK-NEXT:     %3:sreg_32_xm0 = COPY killed %432# CHECK-NEXT:     S_NOP 0, implicit killed %333 34 35################################################################################36# Similar test as above, but with swapped order for the PHI nodes.37# With this PHI node order we did not hit the assert, but we used to get38#39#  bb.3:40#    dead %3:sreg_32_xm0 = COPY killed %441#    %2:sreg_32_xm0 = COPY %442#    S_NOP 0, implicit killed %243#44# which looks weird regarding killed flags for %4.45 46---47name:            bar48tracksRegLiveness: true49body:             |50  bb.0:51    S_CBRANCH_SCC0 %bb.2, implicit undef $scc52 53  bb.1:54    %1:sreg_32_xm0 = S_MOV_B32 25555    S_BRANCH %bb.356 57  bb.2:58    %2:sreg_32_xm0 = S_MOV_B32 25459 60  bb.3:61    %4:sreg_32_xm0 = PHI %2, %bb.2, %1, %bb.162    dead %3:sreg_32_xm0 = PHI undef %2, %bb.2, undef %1, %bb.163    S_NOP 0, implicit %464...65 66# CHECK-LABEL: name:            bar67# CHECK:   bb.3:68# CHECK-NEXT:     dead %3:sreg_32_xm0 = IMPLICIT_DEF69# CHECK-NEXT:     %2:sreg_32_xm0 = COPY killed %470# CHECK-NEXT:     S_NOP 0, implicit killed %271 72 73# The following test crashes in phi-elimination hooks.74#75 76---77name:            bax78tracksRegLiveness: true79body:             |80  bb.0:81    S_CBRANCH_SCC0 %bb.2, implicit undef $scc82 83  bb.1:84    %1:sreg_32_xm0 = S_MOV_B32 25585    S_BRANCH %bb.386 87  bb.2:88    %2:sreg_32_xm0 = S_MOV_B32 25489 90  bb.3:91    %3:sreg_32_xm0 = PHI %2, %bb.2, %1, %bb.192...93 94# CHECK-LABEL: name:            bax95# CHECK:   bb.3:96# CHECK-NEXT:     %2:sreg_32_xm0 = COPY killed %397