[PGO] MST based PGO instrumentation infrastructure
authorRong Xu <xur@google.com>
Tue, 24 Nov 2015 21:31:25 +0000 (21:31 +0000)
committerRong Xu <xur@google.com>
Tue, 24 Nov 2015 21:31:25 +0000 (21:31 +0000)
commit24c623b4e4f6cce49c0ead10bc4bed218a7d33ef
tree46dac8b25d6b4347ee12647ef25e3e3e49f51f07
parentc44b0f4b6b2d949caf02c3a00e26f4f7499ee2d7
[PGO] MST based PGO instrumentation infrastructure

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@254021 91177308-0d34-0410-b5e6-96231b3b80d8
39 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/IPO/LLVMBuild.txt
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/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/loop3.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/single_bb.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/switch.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/branch1_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/branch1_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/branch2_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/branch2_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/checksum_mismatch.ll [new file with mode: 0644]
test/Transforms/PGOProfile/criticaledge_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/criticaledge_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/landingpad_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/landingpad_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop1_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop1_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop2_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop2_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop3_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/loop3_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/noprofile_use.ll [new file with mode: 0644]
test/Transforms/PGOProfile/single_bb_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/switch_gen.ll [new file with mode: 0644]
test/Transforms/PGOProfile/switch_use.ll [new file with mode: 0644]