1 # RUN: llc -run-pass ppc-mi-peepholes -ppc-eliminate-signext -ppc-eliminate-zeroext -verify-machineinstrs -o - %s | FileCheck %s
4 target datalayout = "E-m:e-i64:64-n32:64"
5 target triple = "powerpc64le-unknown-linux-gnu"
6 define ptr @func(ptr %a) {
15 exposesReturnsTwice: false
17 regBankSelected: false
19 tracksRegLiveness: true
21 - { reg: '$x3', virtual-reg: '%0' }
23 isFrameAddressTaken: false
24 isReturnAddressTaken: false
33 hasOpaqueSPAdjustment: false
35 hasMustTailInVarArgFunc: false
40 ; CHECK-LABEL: bb.0.entry:
41 ; CHECK: %4:g8rc = EXTSW_32_64 killed %3
42 ; CHECK: %5:g8rc = INSERT_SUBREG %15, %1, %subreg.sub_32
43 ; CHECK: %7:g8rc = EXTSW_32_64 killed %6
44 ; CHECK: %17:g8rc = INSERT_SUBREG %16, %1, %subreg.sub_32
45 ; CHECK-NEXT: %18:g8rc = ORIS8 killed %17, 32767
46 ; CHECK-NEXT: %8:gprc = COPY killed %18.sub_32
47 ; CHECK: %9:g8rc = INSERT_SUBREG %19, %8, %subreg.sub_32
48 ; CHECK: %21:g8rc = INSERT_SUBREG %20, %1, %subreg.sub_32
49 ; CHECK-NEXT: %22:g8rc = ORI8 killed %21, 32768
50 ; CHECK-NEXT: %10:gprc = COPY killed %22.sub_32
51 ; CHECK: %11:g8rc = INSERT_SUBREG %23, %10, %subreg.sub_32
52 ; CHECK: %14:g8rc = COPY killed %13
54 %0:g8rc_nox0 = COPY $x3
55 %1:gprc, %2:g8rc_nox0 = LBZU 0, %0:g8rc_nox0
56 %3:gprc = COPY %2:g8rc_nox0
57 %4:g8rc = EXTSW_32_64 %3:gprc ; should not be eliminated
58 %5:g8rc = EXTSW_32_64 %1:gprc
60 %6:gprc = ORIS %1:gprc, 32768 ; should not be eliminated
61 %7:g8rc = EXTSW_32_64 %6:gprc
63 %8:gprc = ORIS %1:gprc, 32767
64 %9:g8rc = EXTSW_32_64 %8:gprc
66 %10:gprc = ORI %1:gprc, 32768
67 %11:g8rc = EXTSW_32_64 %10:gprc
69 %12:g8rc = IMPLICIT_DEF
70 %13:g8rc = INSERT_SUBREG %12:g8rc, %1:gprc, %subreg.sub_32
71 %14:g8rc = RLDICL %13:g8rc, 0, 32