[PATCH] D73381: [PGO][PGSO] Handle MBFIWrapper

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 11:03:33 PST 2020


yamauchi marked an inline comment as done.
yamauchi added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Utils/SizeOpts.h:92
+template<typename AdapterT, typename BFIT>
+bool shouldOptimizeForSizeImpl(BlockFrequency BlockFreq,
+                               ProfileSummaryInfo *PSI, BFIT *BFI,
----------------
davidxl wrote:
> Is this function necessary? It is mostly the same as the previous impl.
This version takes a BlockFrequency rather than a block (BlockT). Since only MBFIWrapper, rather than BFI, has the true frequency for the block, we'd need to either (1) get the frequency out of MBFIWrapper and then pass it here, or (2) pass MBFIWrapper down here. The current approach is (1). Either way, we'd need to take the frequency out of MBFIWrapper somwhere along the way, and it won't likely dedup the code as they both require a new param type that doesn't seem to be amenable to additional templatization on top of this already templatized code.

Do you see a better idea?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73381/new/

https://reviews.llvm.org/D73381





More information about the llvm-commits mailing list