OSDN Git Service

[PGO] Memory intrinsic calls optimization based on profiled size
authorRong Xu <xur@google.com>
Tue, 4 Apr 2017 16:42:20 +0000 (16:42 +0000)
committerRong Xu <xur@google.com>
Tue, 4 Apr 2017 16:42:20 +0000 (16:42 +0000)
commit9e52f8ee8b5eac4353557d8d1e85ac7b864a96a2
treed0277ef57668dd483bbc833c0af14d9958d58f1d
parent452506a655fe782eae86cd12a6778de8d57eb4f3
[PGO] Memory intrinsic calls optimization based on profiled size

This patch optimizes two memory intrinsic operations: memset and memcpy based
on the profiled size of the operation. The high level transformation is like:
  mem_op(..., size)
  ==>
  switch (size) {
    case s1:
       mem_op(..., s1);
       goto merge_bb;
    case s2:
       mem_op(..., s2);
       goto merge_bb;
    ...
    default:
       mem_op(..., size);
       goto merge_bb;
    }
  merge_bb:

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299446 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/InitializePasses.h
include/llvm/LinkAllPasses.h
include/llvm/ProfileData/InstrProf.h
include/llvm/Transforms/InstrProfiling.h
include/llvm/Transforms/Instrumentation.h
include/llvm/Transforms/PGOInstrumentation.h
lib/Passes/PassRegistry.def
lib/ProfileData/InstrProf.cpp
lib/Transforms/IPO/PassManagerBuilder.cpp
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
lib/Transforms/Instrumentation/InstrProfiling.cpp
lib/Transforms/Instrumentation/Instrumentation.cpp
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
test/Transforms/PGOProfile/memop_size_opt.ll [new file with mode: 0644]