[PATCH] D15540: [PGO] differentiate FE instrumentation and IR level instrumentation profiles

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 14:37:40 PST 2015


xur created this revision.
xur added reviewers: davidxl, silvas, bogner.
xur added a subscriber: llvm-commits.

This patch uses one bit in profile version to differentiate FE instrumentation and IR level instrumentation profiles. It is based on the suggestion in RFC: PGO Late instrumentation for LLVM
(http://lists.llvm.org/pipermail/llvm-dev/2015-August/089058.html)

PGOInstrumenation now checks this bit to make sure it's IR level instrumentation profiles. PGOInstrumenation also creates a new COMDAT variable __llvm_profile_ir_level and sets the value to 1. This variable tells the profile runtime to set the right version in the generated profiles.

llvm-profdata also handles the profiles differently: mainly for the MaxFunctionCount. For FE profile, it only needs to find the max of the entry count (the first count in the function). For IR level profile, the entry count might not be available, we will set it as the maximum block count in the profile.

http://reviews.llvm.org/D15540

Files:
  include/llvm/ProfileData/InstrProfData.inc
  include/llvm/ProfileData/InstrProfReader.h
  include/llvm/ProfileData/InstrProfWriter.h
  lib/ProfileData/InstrProfReader.cpp
  lib/ProfileData/InstrProfWriter.cpp
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  test/Transforms/PGOProfile/Inputs/branch1.proftext
  test/Transforms/PGOProfile/Inputs/branch2.proftext
  test/Transforms/PGOProfile/Inputs/criticaledge.proftext
  test/Transforms/PGOProfile/Inputs/diag.proftext
  test/Transforms/PGOProfile/Inputs/landingpad.proftext
  test/Transforms/PGOProfile/Inputs/loop1.proftext
  test/Transforms/PGOProfile/Inputs/loop2.proftext
  test/Transforms/PGOProfile/Inputs/switch.proftext
  tools/llvm-profdata/llvm-profdata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15540.42913.patch
Type: text/x-patch
Size: 16962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151215/f3a17fb8/attachment.bin>


More information about the llvm-commits mailing list