[PATCH] D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 11:34:13 PST 2021


xur created this revision.
xur added reviewers: davidxl, wmi, hoy, dblaikie.
Herald added subscribers: wenlei, hiraditya.
xur requested review of this revision.
Herald added a project: LLVM.

This patch makes SampleProfileLoaderBaseImpl a template class so it can be
used in CodeGen transformation.

Noticeable changes:

- use one template parameter and use a typemap to get other used types.
- use a wrapper function getFunction to get IR level function.
- use a wrapper function getEntryBB to get first BB as MachineBasicBlock does not have this API.
- remove the temporary "inline" keywords in previous refactor patch.
- change the template function findEquivalencesFor to a regular function. This function has a single caller with type of PostDominatorTree. It's simpler to use the type directly because MachinePostDominatorTree is not a derived type of template DominatorTreeBase.


https://reviews.llvm.org/D96981

Files:
  llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
  llvm/lib/Transforms/IPO/SampleProfile.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96981.324712.patch
Type: text/x-patch
Size: 22836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210218/4c8eb768/attachment-0001.bin>


More information about the llvm-commits mailing list