267 lines · plain
1# NOTE: This test verifies disable/enable instruction hoisting to hot blocks2# based on profile data3# RUN: llc -run-pass early-machinelicm -verify-machineinstrs \4# RUN: -mtriple=powerpc64le-unknown-linux-gnu \5# RUN: -disable-hoisting-to-hotter-blocks=pgo \6# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \7# RUN: --check-prefix=CHECK-NO-HOIST8# RUN: llc -run-pass early-machinelicm -verify-machineinstrs \9# RUN: -mtriple=powerpc64le-unknown-linux-gnu \10# RUN: -disable-hoisting-to-hotter-blocks=pgo \11# RUN: -block-freq-ratio-threshold=100000000 %s -o - | FileCheck %s \12# RUN: --check-prefix=CHECK-HOIST13# RUN: llc -run-pass early-machinelicm -verify-machineinstrs \14# RUN: -mtriple=powerpc64le-unknown-linux-gnu \15# RUN: -disable-hoisting-to-hotter-blocks=none \16# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \17# RUN: --check-prefix=CHECK-HOIST18# Tests for the new pass manager19# RUN: llc -passes early-machinelicm \20# RUN: -mtriple=powerpc64le-unknown-linux-gnu \21# RUN: -disable-hoisting-to-hotter-blocks=pgo \22# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \23# RUN: --check-prefix=CHECK-NO-HOIST24# RUN: llc -passes early-machinelicm \25# RUN: -mtriple=powerpc64le-unknown-linux-gnu \26# RUN: -disable-hoisting-to-hotter-blocks=pgo \27# RUN: -block-freq-ratio-threshold=100000000 %s -o - | FileCheck %s \28# RUN: --check-prefix=CHECK-HOIST29# RUN: llc -passes early-machinelicm \30# RUN: -mtriple=powerpc64le-unknown-linux-gnu \31# RUN: -disable-hoisting-to-hotter-blocks=none \32# RUN: -block-freq-ratio-threshold=100 %s -o - | FileCheck %s \33# RUN: --check-prefix=CHECK-HOIST34--- |35 target datalayout = "e-m:e-i64:64-n32:64"36 target triple = "powerpc64le-unknown-linux-gnu"37 38 ; Function Attrs: nounwind39 define dso_local void @test(ptr nocapture %fp, i32 signext %Arg, i32 signext %Len, ptr nocapture %Ptr) local_unnamed_addr #0 !prof !29 !section_prefix !30 {40 entry:41 tail call void asm sideeffect "#NOTHING", "~{r2}"() #1, !srcloc !3142 %cmp6 = icmp sgt i32 %Len, 043 br i1 %cmp6, label %for.body.lr.ph, label %for.cond.cleanup, !prof !3244 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 4, !tbaa !3355 %1 = add i32 %i.07, %056 store i32 %1, ptr %Ptr, align 4, !tbaa !3357 br i1 %cmp1, label %if.then, label %for.inc, !prof !3758 59 if.then: ; preds = %for.body60 tail call void asm sideeffect "#NOTHING", "~{r2}"() #1, !srcloc !3161 tail call void %fp(i32 signext %Arg) #1, !prof !3862 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.body, !prof !3968 }69 70 ; Function Attrs: nounwind71 declare void @llvm.stackprotector(ptr, ptr) #172 73 attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64le" "target-features"="+altivec,+bpermd,+crypto,+direct-move,+extdiv,+htm,+power8-vector,+vsx,-power9-vector" "use-soft-float"="false" }74 attributes #1 = { nounwind }75 76 !llvm.module.flags = !{!0, !1}77 !llvm.ident = !{!28}78 79 !0 = !{i32 1, !"wchar_size", i32 4}80 !1 = !{i32 1, !"ProfileSummary", !2}81 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}82 !3 = !{!"ProfileFormat", !"InstrProf"}83 !4 = !{!"TotalCount", i64 25405000087}84 !5 = !{!"MaxCount", i64 21000000020}85 !6 = !{!"MaxInternalCount", i64 200000003}86 !7 = !{!"MaxFunctionCount", i64 21000000020}87 !8 = !{!"NumCounts", i64 15}88 !9 = !{!"NumFunctions", i64 7}89 !10 = !{!"DetailedSummary", !11}90 !11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27}91 !12 = !{i32 10000, i64 21000000020, i32 1}92 !13 = !{i32 100000, i64 21000000020, i32 1}93 !14 = !{i32 200000, i64 21000000020, i32 1}94 !15 = !{i32 300000, i64 21000000020, i32 1}95 !16 = !{i32 400000, i64 21000000020, i32 1}96 !17 = !{i32 500000, i64 21000000020, i32 1}97 !18 = !{i32 600000, i64 21000000020, i32 1}98 !19 = !{i32 700000, i64 21000000020, i32 1}99 !20 = !{i32 800000, i64 21000000020, i32 1}100 !21 = !{i32 900000, i64 4203000000, i32 2}101 !22 = !{i32 950000, i64 4203000000, i32 2}102 !23 = !{i32 990000, i64 4203000000, i32 2}103 !24 = !{i32 999000, i64 200000003, i32 3}104 !25 = !{i32 999900, i64 200000003, i32 3}105 !26 = !{i32 999990, i64 2000000, i32 4}106 !27 = !{i32 999999, i64 2000000, i32 4}107 !28 = !{!"clang version 9.0.0 (git@github.ibm.com:compiler/llvm-project.git 01fc2fc8e690ee427cab149cb0bfd63568bed89b)"}108 !29 = !{!"function_entry_count", i64 200000003}109 !30 = !{!"function_section_prefix", !".hot"}110 !31 = !{i32 65}111 !32 = !{!"branch_weights", i32 -94967292, i32 40000000}112 !33 = !{!34, !34, i64 0}113 !34 = !{!"int", !35, i64 0}114 !35 = !{!"omnipotent char", !36, i64 0}115 !36 = !{!"Simple C/C++ TBAA"}116 !37 = !{!"branch_weights", i32 4, i32 -94967296}117 !38 = !{!"VP", i32 0, i64 20, i64 -3706093650706652785, i64 20}118 !39 = !{!"branch_weights", i32 40000000, i32 -94967292}119 120...121---122name: test123alignment: 4124exposesReturnsTwice: false125legalized: false126regBankSelected: false127selected: false128failedISel: false129tracksRegLiveness: true130hasWinCFI: false131registers:132 - { id: 0, class: crbitrc, preferred-register: '' }133 - { id: 1, class: gprc_and_gprc_nor0, preferred-register: '' }134 - { id: 2, class: gprc, preferred-register: '' }135 - { id: 3, class: g8rc, preferred-register: '' }136 - { id: 4, class: g8rc, preferred-register: '' }137 - { id: 5, class: g8rc, preferred-register: '' }138 - { id: 6, class: g8rc_and_g8rc_nox0, preferred-register: '' }139 - { id: 7, class: gprc, preferred-register: '' }140 - { id: 8, class: gprc, preferred-register: '' }141 - { id: 9, class: crrc, preferred-register: '' }142 - { id: 10, class: gprc, preferred-register: '' }143 - { id: 11, class: crrc, preferred-register: '' }144 - { id: 12, class: gprc, preferred-register: '' }145 - { id: 13, class: gprc, preferred-register: '' }146 - { id: 14, class: g8rc, preferred-register: '' }147 - { id: 15, class: g8rc, preferred-register: '' }148 - { id: 16, class: crrc, preferred-register: '' }149liveins:150 - { reg: '$x3', virtual-reg: '%3' }151 - { reg: '$x4', virtual-reg: '%4' }152 - { reg: '$x5', virtual-reg: '%5' }153 - { reg: '$x6', virtual-reg: '%6' }154frameInfo:155 isFrameAddressTaken: false156 isReturnAddressTaken: false157 hasStackMap: false158 hasPatchPoint: false159 stackSize: 0160 offsetAdjustment: 0161 maxAlignment: 0162 adjustsStack: false163 hasCalls: true164 stackProtector: ''165 maxCallFrameSize: 4294967295166 cvBytesOfCalleeSavedRegisters: 0167 hasOpaqueSPAdjustment: false168 hasVAStart: false169 hasMustTailInVarArgFunc: false170 localFrameSize: 0171 savePoint: []172 restorePoint: []173fixedStack: []174stack: []175constants: []176machineFunctionInfo: {}177body: |178 bb.0.entry:179 successors: %bb.1(0x7ecade30), %bb.2(0x013521d0)180 liveins: $x3, $x4, $x5, $x6181 182 %6:g8rc_and_g8rc_nox0 = COPY $x6183 %5:g8rc = COPY $x5184 %4:g8rc = COPY $x4185 %3:g8rc = COPY $x3186 %7:gprc = COPY %4.sub_32187 %8:gprc = COPY %5.sub_32188 INLINEASM &"#NOTHING", 1, 12, implicit-def early-clobber $r2, !31189 %9:crrc = CMPWI %8, 1190 BCC 12, killed %9, %bb.2191 B %bb.1192 193 bb.1.for.body.lr.ph:194 successors: %bb.3(0x80000000)195 196 INLINEASM &"#NOTHING", 1, 12, implicit-def early-clobber $r2, !31197 %11:crrc = CMPWI %7, 10198 %0:crbitrc = COPY %11.sub_gt199 %10:gprc = LI 0200 B %bb.3201 202 bb.2.for.cond.cleanup:203 BLR8 implicit $lr8, implicit $rm204 205 bb.3.for.body:206 successors: %bb.4(0x00000002), %bb.5(0x7ffffffe)207 208 %1:gprc_and_gprc_nor0 = PHI %10, %bb.1, %2, %bb.5209 %12:gprc = LWZ 0, %6 :: (load (s32) from %ir.Ptr, !tbaa !33)210 %13:gprc = ADD4 %1, killed %12211 STW killed %13, 0, %6 :: (store (s32) into %ir.Ptr, !tbaa !33)212 BCn %0, %bb.5213 B %bb.4214 215 bb.4.if.then:216 successors: %bb.5(0x80000000)217 218 INLINEASM &"#NOTHING", 1, 12, implicit-def early-clobber $r2, !31219 ADJCALLSTACKDOWN 32, 0, implicit-def dead $r1, implicit $r1220 %14:g8rc = COPY $x2221 STD %14, 24, $x1 :: (store (s64) into stack + 24)222 %15:g8rc = EXTSW_32_64 %7223 $x3 = COPY %15224 $x12 = COPY %3225 MTCTR8 %3, implicit-def $ctr8226 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 $r1227 ADJCALLSTACKUP 32, 0, implicit-def dead $r1, implicit $r1228 229 bb.5.for.inc:230 successors: %bb.2(0x013521d0), %bb.3(0x7ecade30)231 232 %2:gprc = nuw nsw ADDI %1, 1233 %16:crrc = CMPLW %8, %2234 BCC 76, killed %16, %bb.2235 B %bb.3236 237...238 239# CHECK for enabling instruction hoisting240#CHECK-LABEL: test241#CHECK-HOIST: bb.1.for.body.lr.ph:242#CHECK-HOIST: %14:g8rc = COPY $x2243#CHECK-HOIST: STD %14, 24, $x1 :: (store (s64) into stack + 24)244#CHECK-HOIST: %15:g8rc = EXTSW_32_64 %7245#CHECK-HOIST: B %bb.3246 247#CHECK-HOIST: bb.4.if.then:248#CHECK-HOIST-NOT: %14:g8rc = COPY $x2249#CHECK-HOIST-NOT: STD %14, 24, $x1 :: (store (s64) into stack + 24)250#CHECK-HOIST-NOT: %15:g8rc = EXTSW_32_64 %7251#CHECK-HOIST: bb.5.for.inc:252 253# CHECK for disabling instruction hoisting due to block hotness254#CHECK-LABEL: test255#CHECK-NO-HOIST: bb.1.for.body.lr.ph:256#CHECK-NO-HOIST-NOT: %14:g8rc = COPY $x2257#CHECK-NO-HOIST-NOT: STD %14, 24, $x1 :: (store (s64) into stack + 24)258#CHECK-NO-HOIST-NOT: %15:g8rc = EXTSW_32_64 %7259#CHECK-NO-HOIST: B %bb.3260 261#CHECK-NO-HOIST: bb.4.if.then:262#CHECK-NO-HOIST: %14:g8rc = COPY $x2263#CHECK-NO-HOIST: STD %14, 24, $x1 :: (store (s64) into stack + 24)264#CHECK-NO-HOIST: %15:g8rc = EXTSW_32_64 %7265#CHECK-NO-HOIST: bb.5.for.inc:266 267