221 lines · plain
1# NOTE: This test verifies disable/enable instruction hoisting to hot blocks2# based on non-profile data3# RUN: llc -run-pass early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \4# RUN: -verify-machineinstrs -disable-hoisting-to-hotter-blocks=all \5# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \6# RUN: --check-prefix=CHECK-NO-HOIST7# RUN: llc -run-pass early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \8# RUN: -verify-machineinstrs -disable-hoisting-to-hotter-blocks=all \9# RUN: -block-freq-ratio-threshold=100000000 %s -o - | FileCheck %s \10# RUN: --check-prefix=CHECK-HOIST11# RUN: llc -run-pass early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \12# RUN: -verify-machineinstrs -disable-hoisting-to-hotter-blocks=pgo \13# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \14# RUN: --check-prefix=CHECK-HOIST15# RUN: llc -run-pass early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \16# RUN: -verify-machineinstrs -disable-hoisting-to-hotter-blocks=none \17# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \18# RUN: --check-prefix=CHECK-HOIST19# Tests for new pass manager20# RUN: llc -passes early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \21# RUN: -disable-hoisting-to-hotter-blocks=all \22# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \23# RUN: --check-prefix=CHECK-NO-HOIST24# RUN: llc -passes early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \25# RUN: -disable-hoisting-to-hotter-blocks=all \26# RUN: -block-freq-ratio-threshold=100000000 %s -o - | FileCheck %s \27# RUN: --check-prefix=CHECK-HOIST28# RUN: llc -passes early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \29# RUN: -disable-hoisting-to-hotter-blocks=pgo \30# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \31# RUN: --check-prefix=CHECK-HOIST32# RUN: llc -passes early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \33# RUN: -disable-hoisting-to-hotter-blocks=none \34# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \35# RUN: --check-prefix=CHECK-HOIST36--- |37 target datalayout = "e-m:e-i64:64-n32:64"38 39 define dso_local void @test(ptr nocapture %fp, i32 signext %Arg, i32 signext %Len, ptr nocapture %Ptr) {40 entry:41 tail call void asm sideeffect "#NOTHING", "~{r2}"()42 %cmp6 = icmp sgt i32 %Len, 043 br i1 %cmp6, label %for.body.lr.ph, label %for.cond.cleanup44 45 for.body.lr.ph: ; preds = %entry46 %cmp1 = icmp sgt i32 %Arg, 1047 br label %for.body48 49 for.cond.cleanup: ; preds = %for.inc, %entry50 ret void51 52 for.body: ; preds = %for.inc, %for.body.lr.ph53 %i.07 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]54 %0 = load i32, ptr %Ptr, align 455 %1 = add i32 %i.07, %056 store i32 %1, ptr %Ptr, align 457 br i1 %cmp1, label %if.then, label %for.inc58 59 if.then: ; preds = %for.body60 tail call void asm sideeffect "#NOTHING", "~{r2}"()61 tail call void %fp(i32 signext %Arg)62 br label %for.inc63 64 for.inc: ; preds = %if.then, %for.body65 %inc = add nuw nsw i32 %i.07, 166 %exitcond = icmp eq i32 %Len, %inc67 br i1 %exitcond, label %for.cond.cleanup, label %for.body68 }69 70 ; Function Attrs: nounwind71 declare void @llvm.stackprotector(ptr, ptr) #072 73 attributes #0 = { nounwind }74 75...76---77name: test78alignment: 479exposesReturnsTwice: false80legalized: false81regBankSelected: false82selected: false83failedISel: false84tracksRegLiveness: true85hasWinCFI: false86registers:87 - { id: 0, class: crbitrc, preferred-register: '' }88 - { id: 1, class: gprc_and_gprc_nor0, preferred-register: '' }89 - { id: 2, class: gprc, preferred-register: '' }90 - { id: 3, class: g8rc, preferred-register: '' }91 - { id: 4, class: g8rc, preferred-register: '' }92 - { id: 5, class: g8rc, preferred-register: '' }93 - { id: 6, class: g8rc_and_g8rc_nox0, preferred-register: '' }94 - { id: 7, class: gprc, preferred-register: '' }95 - { id: 8, class: gprc, preferred-register: '' }96 - { id: 9, class: crrc, preferred-register: '' }97 - { id: 10, class: gprc, preferred-register: '' }98 - { id: 11, class: crrc, preferred-register: '' }99 - { id: 12, class: gprc, preferred-register: '' }100 - { id: 13, class: gprc, preferred-register: '' }101 - { id: 14, class: g8rc, preferred-register: '' }102 - { id: 15, class: g8rc, preferred-register: '' }103 - { id: 16, class: crrc, preferred-register: '' }104liveins:105 - { reg: '$x3', virtual-reg: '%3' }106 - { reg: '$x4', virtual-reg: '%4' }107 - { reg: '$x5', virtual-reg: '%5' }108 - { reg: '$x6', virtual-reg: '%6' }109frameInfo:110 isFrameAddressTaken: false111 isReturnAddressTaken: false112 hasStackMap: false113 hasPatchPoint: false114 stackSize: 0115 offsetAdjustment: 0116 maxAlignment: 0117 adjustsStack: false118 hasCalls: true119 stackProtector: ''120 maxCallFrameSize: 4294967295121 cvBytesOfCalleeSavedRegisters: 0122 hasOpaqueSPAdjustment: false123 hasVAStart: false124 hasMustTailInVarArgFunc: false125 localFrameSize: 0126 savePoint: []127 restorePoint: []128fixedStack: []129stack: []130constants: []131machineFunctionInfo: {}132body: |133 bb.0.entry:134 successors: %bb.1(0x7ecade30), %bb.2(0x013521d0)135 liveins: $x3, $x4, $x5, $x6136 137 %6:g8rc_and_g8rc_nox0 = COPY $x6138 %5:g8rc = COPY $x5139 %4:g8rc = COPY $x4140 %3:g8rc = COPY $x3141 %7:gprc = COPY %4.sub_32142 %8:gprc = COPY %5.sub_32143 INLINEASM &"#NOTHING", 1, 12, implicit-def early-clobber $r2144 %9:crrc = CMPWI %8, 1145 BCC 12, killed %9, %bb.2146 B %bb.1147 148 bb.1.for.body.lr.ph:149 successors: %bb.3(0x80000000)150 151 INLINEASM &"#NOTHING", 1, 12, implicit-def early-clobber $r2152 %11:crrc = CMPWI %7, 10153 %0:crbitrc = COPY %11.sub_gt154 %10:gprc = LI 0155 B %bb.3156 157 bb.2.for.cond.cleanup:158 BLR8 implicit $lr8, implicit $rm159 160 bb.3.for.body:161 successors: %bb.4(0x00000002), %bb.5(0x7ffffffe)162 163 %1:gprc_and_gprc_nor0 = PHI %10, %bb.1, %2, %bb.5164 %12:gprc = LWZ 0, %6 :: (load (s32) from %ir.Ptr)165 %13:gprc = ADD4 %1, killed %12166 STW killed %13, 0, %6 :: (store (s32) into %ir.Ptr)167 BCn %0, %bb.5168 B %bb.4169 170 bb.4.if.then:171 successors: %bb.5(0x80000000)172 173 INLINEASM &"#NOTHING", 1, 12, implicit-def early-clobber $r2174 ADJCALLSTACKDOWN 32, 0, implicit-def dead $r1, implicit $r1175 %14:g8rc = COPY $x2176 STD %14, 24, $x1 :: (store (s64) into stack + 24)177 %15:g8rc = EXTSW_32_64 %7178 $x3 = COPY %15179 $x12 = COPY %3180 MTCTR8 %3, implicit-def $ctr8181 BCTRL8_LDinto_toc 24, $x1, csr_ppc64_altivec, implicit-def dead $lr8, implicit-def dead $x2, implicit $ctr8, implicit $rm, implicit $x3, implicit $x12, implicit $x2, implicit-def $r1182 ADJCALLSTACKUP 32, 0, implicit-def dead $r1, implicit $r1183 184 bb.5.for.inc:185 successors: %bb.2(0x013521d0), %bb.3(0x7ecade30)186 187 %2:gprc = nuw nsw ADDI %1, 1188 %16:crrc = CMPLW %8, %2189 BCC 76, killed %16, %bb.2190 B %bb.3191 192...193 194# CHECK for enabling instruction hoisting195#CHECK-LABEL: test196#CHECK-HOIST: bb.1.for.body.lr.ph:197#CHECK-HOIST: %14:g8rc = COPY $x2198#CHECK-HOIST: STD %14, 24, $x1 :: (store (s64) into stack + 24)199#CHECK-HOIST: %15:g8rc = EXTSW_32_64 %7200#CHECK-HOIST: B %bb.3201 202#CHECK-HOIST: bb.4.if.then:203#CHECK-HOIST-NOT: %14:g8rc = COPY $x2204#CHECK-HOIST-NOT: STD %14, 24, $x1 :: (store (s64) into stack + 24)205#CHECK-HOIST-NOT: %15:g8rc = EXTSW_32_64 %7206#CHECK-HOIST: bb.5.for.inc:207 208# CHECK for disabling instruction hoisting due to block hotness209#CHECK-LABEL: test210#CHECK-NO-HOIST: bb.1.for.body.lr.ph:211#CHECK-NO-HOIST-NOT: %14:g8rc = COPY $x2212#CHECK-NO-HOIST-NOT: STD %14, 24, $x1 :: (store (s64) into stack + 24)213#CHECK-NO-HOIST-NOT: %15:g8rc = EXTSW_32_64 %7214#CHECK-NO-HOIST: B %bb.3215 216#CHECK-NO-HOIST: bb.4.if.then:217#CHECK-NO-HOIST: %14:g8rc = COPY $x2218#CHECK-NO-HOIST: STD %14, 24, $x1 :: (store (s64) into stack + 24)219#CHECK-NO-HOIST: %15:g8rc = EXTSW_32_64 %7220#CHECK-NO-HOIST: bb.5.for.inc:221