[PGO] Resubmit "MST based PGO instrumentation infrastructure" (r254021)
authorRong Xu <xur@google.com>
Wed, 9 Dec 2015 18:08:16 +0000 (18:08 +0000)
committerRong Xu <xur@google.com>
Wed, 9 Dec 2015 18:08:16 +0000 (18:08 +0000)
commit65711ad4e36f91de64aa3dde76fde143cec85c83
tree0c3ed5d3bc931e7ed196f4df3e5a11d836e41bff
parent09a7daad01b02482a58fb2ad6972e80871040c84
[PGO] Resubmit "MST based PGO instrumentation infrastructure" (r254021)

This new patch fixes a few bugs that exposed in last submit. It also improves
the test cases.
--Original Commit Message--
This patch implements a minimum spanning tree (MST) based instrumentation for
PGO. The use of MST guarantees minimum number of CFG edges getting
instrumented. An addition optimization is to instrument the less executed
edges to further reduce the instrumentation overhead. The patch contains both the
instrumentation and the use of the profile to set the branch weights.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255132 91177308-0d34-0410-b5e6-96231b3b80d8
29 files changed:
include/llvm/IR/DiagnosticInfo.h
include/llvm/InitializePasses.h
include/llvm/LinkAllPasses.h
include/llvm/Transforms/Instrumentation.h
lib/IR/DiagnosticInfo.cpp
lib/Transforms/Instrumentation/CFGMST.h [new file with mode: 0644]
lib/Transforms/Instrumentation/CMakeLists.txt
lib/Transforms/Instrumentation/Instrumentation.cpp
lib/Transforms/Instrumentation/LLVMBuild.txt
lib/Transforms/Instrumentation/PGOInstrumentation.cpp [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/branch1.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/branch2.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/criticaledge.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/diag.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/landingpad.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/loop1.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/loop2.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/switch.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/branch1.ll [new file with mode: 0644]
test/Transforms/PGOProfile/branch2.ll [new file with mode: 0644]
test/Transforms/PGOProfile/criticaledge.ll [new file with mode: 0644]
test/Transforms/PGOProfile/diag_mismatch.ll [new file with mode: 0644]
test/Transforms/PGOProfile/diag_no_funcprofdata.ll [new file with mode: 0644]
test/Transforms/PGOProfile/diag_no_profile.ll [new file with mode: 0644]
test/Transforms/PGOProfile/landingpad.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop1.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop2.ll [new file with mode: 0644]
test/Transforms/PGOProfile/single_bb.ll [new file with mode: 0644]
test/Transforms/PGOProfile/switch.ll [new file with mode: 0644]