[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)
commitf430ae40cfb91481ad6bc49c48e0b01557826251
tree73e8fd4ecc6556fc23b732cb02daf95c7918d469
parentf0cccb3189c07c3920c07191821b7ea7fd512177
[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

llvm-svn: 255132
29 files changed:
llvm/include/llvm/IR/DiagnosticInfo.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/include/llvm/Transforms/Instrumentation.h
llvm/lib/IR/DiagnosticInfo.cpp
llvm/lib/Transforms/Instrumentation/CFGMST.h [new file with mode: 0644]
llvm/lib/Transforms/Instrumentation/CMakeLists.txt
llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
llvm/lib/Transforms/Instrumentation/LLVMBuild.txt
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/diag.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/switch.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/branch1.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/branch2.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/criticaledge.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/diag_mismatch.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/diag_no_funcprofdata.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/diag_no_profile.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/landingpad.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/loop1.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/loop2.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/single_bb.ll [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/switch.ll [new file with mode: 0644]