This revision was automatically updated to reflect the committed changes.
Closed by commit rG50da55a58534: [PGO] Supporting code for always instrumenting
entry block (authored by xur).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Changed prior to commit:
https://reviews.llvm.org/D84261?vs=279904=279952#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84261/new/
https://reviews.llvm.org/D84261
Files:
clang/test/CodeGenCXX/Inputs/profile-remap_entry.proftext
clang/test/CodeGenCXX/profile-remap.cpp
clang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext
clang/test/Profile/gcc-flag-compatibility.c
llvm/include/llvm/ProfileData/InstrProf.h
llvm/include/llvm/ProfileData/InstrProfData.inc
llvm/include/llvm/ProfileData/InstrProfReader.h
llvm/include/llvm/ProfileData/InstrProfWriter.h
llvm/lib/ProfileData/InstrProf.cpp
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/lib/ProfileData/InstrProfWriter.cpp
llvm/lib/Transforms/Instrumentation/CFGMST.h
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/test/Transforms/PGOProfile/Inputs/branch2_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/criticaledge_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/indirectbr_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/landingpad_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/loop1_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/loop2_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/select1.proftext
llvm/test/Transforms/PGOProfile/Inputs/select2.proftext
llvm/test/Transforms/PGOProfile/Inputs/switch_entry.proftext
llvm/test/Transforms/PGOProfile/branch2.ll
llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
llvm/test/Transforms/PGOProfile/criticaledge.ll
llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
llvm/test/Transforms/PGOProfile/indirectbr.ll
llvm/test/Transforms/PGOProfile/irreducible.ll
llvm/test/Transforms/PGOProfile/landingpad.ll
llvm/test/Transforms/PGOProfile/loop1.ll
llvm/test/Transforms/PGOProfile/loop2.ll
llvm/test/Transforms/PGOProfile/misexpect-branch-stripped.ll
llvm/test/Transforms/PGOProfile/misexpect-branch.ll
llvm/test/Transforms/PGOProfile/misexpect-switch-default.ll
llvm/test/Transforms/PGOProfile/misexpect-switch.ll
llvm/test/Transforms/PGOProfile/switch.ll
llvm/test/Transforms/PGOProfile/thinlto_cspgo_use.ll
llvm/test/tools/llvm-profdata/Inputs/header-directives-1.proftext
llvm/test/tools/llvm-profdata/Inputs/header-directives-2.proftext
llvm/test/tools/llvm-profdata/Inputs/header-directives-3.proftext
llvm/test/tools/llvm-profdata/header-directives.test
llvm/tools/llvm-profdata/llvm-profdata.cpp
Index: llvm/tools/llvm-profdata/llvm-profdata.cpp
===
--- llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -251,6 +251,7 @@
Filename);
return;
}
+ WC->Writer.setInstrEntryBBEnabled(Reader->instrEntryBBEnabled());
for (auto : *Reader) {
if (Remapper)
@@ -977,8 +978,11 @@
if (TextFormat)
return 0;
std::unique_ptr PS(Builder.getSummary());
- OS << "Instrumentation level: "
- << (Reader->isIRLevelProfile() ? "IR" : "Front-end") << "\n";
+ bool IsIR = Reader->isIRLevelProfile();
+ OS << "Instrumentation level: " << (IsIR ? "IR" : "Front-end");
+ if (IsIR)
+OS << " entry_first = " << Reader->instrEntryBBEnabled();
+ OS << "\n";
if (ShowAllFunctions || !ShowFunction.empty())
OS << "Functions shown: " << ShownFunctions << "\n";
OS << "Total functions: " << PS->getNumFunctions() << "\n";
Index: llvm/test/tools/llvm-profdata/header-directives.test
===
--- /dev/null
+++ llvm/test/tools/llvm-profdata/header-directives.test
@@ -0,0 +1,10 @@
+RUN: llvm-profdata show %p/Inputs/header-directives-1.proftext -o - | FileCheck %s --check-prefixes=ENTRYFIRST,CHECK
+RUN: llvm-profdata show %p/Inputs/header-directives-2.proftext -o - | FileCheck %s --check-prefixes=NOTENTRYFIRST,CHECK
+RUN: llvm-profdata show %p/Inputs/header-directives-3.proftext -o - | FileCheck %s --check-prefixes=ENTRYFIRST,CHECK
+
+ENTRYFIRST: Instrumentation level: IR entry_first = 1
+NOTENTRYFIRST: Instrumentation level: IR entry_first = 0
+CHECK: Total functions: 1
+CHECK: Maximum function count: 100
+CHECK: Maximum internal block count: 90
+
Index: llvm/test/tools/llvm-profdata/Inputs/header-directives-3.proftext