[PGO] Supporting code for always instrumenting entry block
authorRong Xu <xur@google.com>
Wed, 22 Jul 2020 21:58:42 +0000 (14:58 -0700)
committerRong Xu <xur@google.com>
Wed, 22 Jul 2020 22:01:53 +0000 (15:01 -0700)
commit50da55a58534e9207d8d5e31c8b4b5cf0c624175
tree7c103621e146290d18d85160106b26f81606274c
parente0ee2288424952e0445f096ae7800472eac11249
[PGO] Supporting code for always instrumenting entry block

This patch includes the supporting code that enables always
instrumenting the function entry block by default.

This patch will NOT the default behavior.

It adds a variant bit in the profile version, adds new directives in
text profile format, and changes llvm-profdata tool accordingly.

This patch is a split of D83024 (https://reviews.llvm.org/D83024)
Many test changes from D83024 are also included.

Differential Revision: https://reviews.llvm.org/D84261
47 files changed:
clang/test/CodeGenCXX/Inputs/profile-remap_entry.proftext [new file with mode: 0644]
clang/test/CodeGenCXX/profile-remap.cpp
clang/test/Profile/Inputs/gcc-flag-compatibility_IR_entry.proftext [new file with mode: 0644]
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 [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/criticaledge_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext
llvm/test/Transforms/PGOProfile/Inputs/indirectbr_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/landingpad_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/loop1_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/loop2_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/misexpect-branch_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch-correct_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/misexpect-switch_entry.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/select1.proftext
llvm/test/Transforms/PGOProfile/Inputs/select2.proftext
llvm/test/Transforms/PGOProfile/Inputs/switch_entry.proftext [new file with mode: 0644]
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 [new file with mode: 0644]
llvm/test/tools/llvm-profdata/Inputs/header-directives-2.proftext [new file with mode: 0644]
llvm/test/tools/llvm-profdata/Inputs/header-directives-3.proftext [new file with mode: 0644]
llvm/test/tools/llvm-profdata/header-directives.test [new file with mode: 0644]
llvm/tools/llvm-profdata/llvm-profdata.cpp