[PATCH] D142747: [Pseudo Probe] Do not instrument EH blocks.

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 18:27:51 PST 2023


wenlei added inline comments.


================
Comment at: llvm/include/llvm/Analysis/EHUtils.h:17
+/// Compute a list of blocks that are only reachable via EH paths.
+template <typename AccessorTraits, typename FunctionT, typename BlockT>
+static void computeEHOnlyBlocks(FunctionT &F, DenseSet<BlockT *> &EHBlocks) {
----------------
1. Is the need for AccessorTraits because of the different API between MBB (member `predecessors()`) vs BB (standalone `predecessors()`)? 

2. If we have to use AccessorTraits, can we avoid exposing it as template type at the top level API (`computeEHOnlyBlocks`)? I think we should be able to select the right traits based on BlockT. 

3. Since we only need successor/predecessor, I'd suggest we decouple this from `afdo_detail::IRTraits`. That is, we define two small traits here for both MBB and BB.


================
Comment at: llvm/lib/CodeGen/MachineFunctionSplitter.cpp:90
+static void setDescendantEHBlocksCold(MachineFunction &MF) {
+  struct MIRTraits {
+    static auto getPredecessors(MachineBasicBlock *BB) {
----------------
As mentioned above, this better be moved into `EHUtils.h`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142747



More information about the llvm-commits mailing list