94 lines · plain
1# RUN: llc -mtriple powerpc64-unknown-linux-gnu -run-pass livevars -run-pass phi-node-elimination -verify-machineinstrs -o - %s | FileCheck %s2# RUN: llc -mtriple powerpc64-unknown-linux-gnu --passes='require<live-vars>,phi-node-elimination' -verify-each -o - %s | FileCheck %s3 4# This test case was originally known as5# test/CodeGen/PowerPC/2013-07-01-PHIElimBug.ll6#7# It was discovered that the original test case no longer reproduced the bug8# from PR16508 (solved in rL185363). That could have been resolved by adding9# -O1 (or possibly -O0) to the run line, but instead the test case was10# converted into this .mir test case. Having it as a .mir test should make it11# less sensitive to changes in earlier passes.12 13--- |14 target datalayout = "E-m:e-i64:64-n32:64"15 target triple = "powerpc64-unknown-linux-gnu"16 17 @g_51 = external global [8 x i32], align 418 define void @func_7() {19 bb.0:20 ret void21 }22...23---24name: func_725tracksRegLiveness: true26body: |27 bb.0:28 liveins: $x229 30 %0:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @g_5131 %1:g8rc_and_g8rc_nox0 = LDtocL @g_51, killed %0, implicit $x2 :: (load (s64))32 %2:gprc = LI 033 %3:crrc = CMPLWI killed %2, 034 BCC 76, killed %3, %bb.235 36 bb.1:37 %4:g8rc = ADDI8 killed %1, 2438 B %bb.439 40 bb.2:41 %5:g8rc = ADDI8 killed %1, 2442 %6:g8rc = LI8 043 %7:crrc = CMPLWI undef %8:gprc, 2044 45 bb.3:46 %9:g8rc = PHI %5, %bb.2, %10, %bb.347 %10:g8rc = PHI %6, %bb.2, undef %11:g8rc, %bb.348 BCC 68, %7, %bb.349 B %bb.450 51 bb.4:52 %12:g8rc_and_g8rc_nox0 = PHI %4, %bb.1, %9, %bb.353 %13:g8rc = LI8 054 STW8 killed %13, 0, killed %12 :: (store (s32))55 BLR8 implicit $lr8, implicit $rm56 57...58 59# Original TR (and 2013-07-01-PHIElimBug.ll) was about verifier errors for bb.3.60#61# I got a feeling that we also need to have some checks to see that # the code62# is correct in some way. Hopefully this test case is stable enough to verify63# the full MIR like this.64#65# CHECK: bb.0:66# CHECK: %0:g8rc_and_g8rc_nox0 = ADDIStocHA8 $x2, @g_5167# CHECK-NEXT: %1:g8rc_and_g8rc_nox0 = LDtocL @g_51, killed %0, implicit killed $x2 :: (load (s64))68# CHECK-NEXT: %2:gprc = LI 069# CHECK-NEXT: %3:crrc = CMPLWI killed %2, 070# CHECK-NEXT: BCC 76, killed %3, %bb.271# CHECK: bb.1:72# CHECK: %4:g8rc = ADDI8 killed %1, 2473# CHECK-NEXT: %16:g8rc_and_g8rc_nox0 = COPY killed %474# CHECK-NEXT: B %bb.475# CHECK: bb.2:76# CHECK: %5:g8rc = ADDI8 killed %1, 2477# CHECK-NEXT: %6:g8rc = LI8 078# CHECK-NEXT: %7:crrc = CMPLWI undef %8:gprc, 2079# CHECK-NEXT: %14:g8rc = COPY killed %580# CHECK-NEXT: %15:g8rc = COPY killed %681# CHECK: bb.3:82# CHECK: %10:g8rc = COPY killed %1583# CHECK-NEXT: %9:g8rc = COPY killed %1484# CHECK-NEXT: %14:g8rc = COPY killed %1085# CHECK-NEXT: %15:g8rc = IMPLICIT_DEF86# CHECK-NEXT: %16:g8rc_and_g8rc_nox0 = COPY killed %987# CHECK-NEXT: BCC 68, %7, %bb.388# CHECK-NEXT: B %bb.489# CHECK: bb.4:90# CHECK: %12:g8rc_and_g8rc_nox0 = COPY killed %1691# CHECK-NEXT: %13:g8rc = LI8 092# CHECK-NEXT: STW8 killed %13, 0, killed %12 :: (store (s32))93# CHECK-NEXT: BLR8 implicit $lr8, implicit $rm94