[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles
authorRong Xu <xur@google.com>
Mon, 8 Feb 2016 21:07:46 +0000 (21:07 +0000)
committerRong Xu <xur@google.com>
Mon, 8 Feb 2016 21:07:46 +0000 (21:07 +0000)
commit1288a19421232137ed288e4b9ba202f3b37b2006
treea5c81a0b9a6c6f2ff258444f914e829610b6f3ab
parent264d7e5b685a739f52e680089ba92f0129708687
[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles

This patch uses one bit in profile version to differentiate Clang
instrumentation and IR level instrumentation profiles.

PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so
that the compiler runtime can set the right profile kind.
PGOInstrumenation now checks this bit to make sure it's an IR level
instrumentation profile.

Differential Revision: http://reviews.llvm.org/D15540

llvm-svn: 260146
25 files changed:
llvm/include/llvm/ProfileData/InstrProfData.inc
llvm/include/llvm/ProfileData/InstrProfReader.h
llvm/include/llvm/ProfileData/InstrProfWriter.h
llvm/lib/ProfileData/InstrProfReader.cpp
llvm/lib/ProfileData/InstrProfWriter.cpp
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext
llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext
llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext
llvm/test/Transforms/PGOProfile/Inputs/diag.proftext
llvm/test/Transforms/PGOProfile/Inputs/diag_FE.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext
llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext
llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext
llvm/test/Transforms/PGOProfile/Inputs/switch.proftext
llvm/test/Transforms/PGOProfile/branch1.ll
llvm/test/Transforms/PGOProfile/branch2.ll
llvm/test/Transforms/PGOProfile/criticaledge.ll
llvm/test/Transforms/PGOProfile/diag_FE_profile.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/landingpad.ll
llvm/test/Transforms/PGOProfile/loop1.ll
llvm/test/Transforms/PGOProfile/loop2.ll
llvm/test/Transforms/PGOProfile/single_bb.ll
llvm/test/Transforms/PGOProfile/switch.ll
llvm/tools/llvm-profdata/llvm-profdata.cpp