84 lines · plain
1; Test default llvm-profgen with preinline off2; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=0 --gen-cs-nested-profile=0 --output=%t13; RUN: FileCheck %s --input-file %t1 --check-prefix=CHECK-DEFAULT4 5; Test llvm-profgen with preinliner on will merge not inlinable profile into base profile.6; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --gen-cs-nested-profile=0 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t27; RUN: FileCheck %s --input-file %t2 --check-prefix=CHECK-PREINL8 9; Test preinliner threshold that prevents all possible inlining and merges everything into base profile.10; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --gen-cs-nested-profile=0 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=0 --output=%t311; RUN: FileCheck %s --input-file %t3 --check-prefix=CHECK-NO-PREINL12 13; Test cold profile trimming. Only base profiles should be dropped.14; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --gen-cs-nested-profile=0 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t4 --trim-cold-profile=1 --profile-summary-hot-count=40015 16; RUN: FileCheck %s --input-file %t4 --check-prefix=CHECK-TRIM17 18; Test llvm-profgen with preinliner on will merge not inlinable profile into base profile.19; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t5 --gen-cs-nested-profile=120; RUN: FileCheck %s --input-file %t5 --check-prefix=CHECK-PREINL-NEST21 22; Test preInlined flat is set for extbinary profiles with preinliner on.23; RUN: llvm-profgen --format=extbinary --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --gen-cs-nested-profile=0 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t2.prof24; RUN: llvm-profdata show --sample -show-sec-info-only %t2.prof | FileCheck %s -check-prefix=CHECK-PREINL-FLAG25; RUN: llvm-profgen --format=extbinary --perfscript=%S/Inputs/inline-cs-noprobe.perfscript --binary=%S/Inputs/inline-cs-noprobe.perfbin --csspgo-preinliner=1 --sample-profile-hot-inline-threshold=3000 --sample-profile-cold-inline-threshold=45 --output=%t5.prof --gen-cs-nested-profile=126; RUN: llvm-profdata show --sample -show-sec-info-only %t5.prof | FileCheck %s -check-prefix=CHECK-PREINL-FLAG27 28; Test preInlined flat is set when converted from a text profile that has "ShouldInline" contexts.29; RUN: llvm-profdata merge --sample %t2 -o %t2.prof --extbinary30; RUN: llvm-profdata show --sample -show-sec-info-only %t2.prof | FileCheck %s -check-prefix=CHECK-PREINL-FLAG31; RUN: llvm-profdata merge --sample %t5 -o %t5.prof --extbinary32; RUN: llvm-profdata show --sample -show-sec-info-only %t5.prof | FileCheck %s -check-prefix=CHECK-PREINL-FLAG33 34 35; CHECK-DEFAULT: [main:1 @ foo]:309:036; CHECK-DEFAULT-NEXT: 2.1: 1437; CHECK-DEFAULT-NEXT: 3: 1538; CHECK-DEFAULT-NEXT: 3.1: 14 bar:1439; CHECK-DEFAULT-NEXT: 3.2: 140; CHECK-DEFAULT-NEXT: 65526: 1441; CHECK-DEFAULT-NEXT: !Attributes: 142; CHECK-DEFAULT-NEXT:[main:1 @ foo:3.1 @ bar]:84:043; CHECK-DEFAULT-NEXT: 1: 1444; CHECK-DEFAULT-NEXT: !Attributes: 145 46; CHECK-PREINL: [foo]:309:047; CHECK-PREINL-NEXT: 2.1: 1448; CHECK-PREINL-NEXT: 3: 1549; CHECK-PREINL-NEXT: 3.1: 14 bar:1450; CHECK-PREINL-NEXT: 3.2: 151; CHECK-PREINL-NEXT: 65526: 1452; CHECK-PREINL-NEXT: !Attributes: 153; CHECK-PREINL-NEXT:[foo:3.1 @ bar]:84:054; CHECK-PREINL-NEXT: 1: 1455; CHECK-PREINL-NEXT: !Attributes: 356 57; CHECK-NO-PREINL: [foo]:309:058; CHECK-NO-PREINL-NEXT: 2.1: 1459; CHECK-NO-PREINL-NEXT: 3: 1560; CHECK-NO-PREINL-NEXT: 3.1: 14 bar:1461; CHECK-NO-PREINL-NEXT: 3.2: 162; CHECK-NO-PREINL-NEXT: 65526: 1463; CHECK-NO-PREINL-NEXT: !Attributes: 164; CHECK-NO-PREINL-NEXT:[bar]:84:065; CHECK-NO-PREINL-NEXT: 1: 1466; CHECK-NO-PREINL-NEXT: !Attributes: 167 68; CHECK-TRIM-NOT: [foo]:309:069; CHECK-TRIM:[foo:3.1 @ bar]:84:070; CHECK-TRIM-NEXT: 1: 1471; CHECK-TRIM-NEXT: !Attributes: 372 73; CHECK-PREINL-NEST: foo:379:074; CHECK-PREINL-NEST-NEXT: 2.1: 1475; CHECK-PREINL-NEST-NEXT: 3: 1576; CHECK-PREINL-NEST-NEXT: 3.2: 177; CHECK-PREINL-NEST-NEXT: 65526: 1478; CHECK-PREINL-NEST-NEXT: 3.1: bar:8479; CHECK-PREINL-NEST-NEXT: 1: 1480; CHECK-PREINL-NEST-NEXT: !Attributes: 381 82 83; CHECK-PREINL-FLAG: ProfileSummarySection {{.*}} Flags: {{{.*}}preInlined}84