aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2021-02-09 19:43:26 -0800
committerRong Xu <xur@google.com>2021-02-10 13:29:15 -0800
commitdb0d7d0ba9f9d6c03263234beabb1c0b8435a445 (patch)
tree02342351b562ded673b83ce9d183838e4a62a020 /clang/lib/Frontend/TestModuleFileExtension.cpp
parent9283058abbec3d2236e69556206b4e66bf52045b (diff)
downloadllvm-db0d7d0ba9f9d6c03263234beabb1c0b8435a445.zip
llvm-db0d7d0ba9f9d6c03263234beabb1c0b8435a445.tar.gz
llvm-db0d7d0ba9f9d6c03263234beabb1c0b8435a445.tar.bz2
[SampleFDO][NFC] Refactor SampleProfileLoader to reuse in CodeGen
Break SampleProfileLoader into to a base and a derived class. Base class (SampleProfileLoaderBaseImpl) includes the common code for IR and MachineIR (CodeGen) sample loader. It will be templatelized in the later patch. Inline and Probe related code will remain in the derived class of SampleProfileLoader and stays in SampleProfile.cpp. We need to refactor some functions: (1) getInstWeight() to enable the code sharing -- put the core into getInstWeightImpl(). (2) emitAnnotation() and propagateWeights() to carve out the code specific to SampleProfileLoader. (3) make getInstWeight() and findFunctionSamples() virtual and override in SampleProfileLoader as they need to access the fields in the derived class. Differential Revision: https://reviews.llvm.org/D95832
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions