[PATCH] D155514: [BOLT] Introduce ProfileUseDFS option

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 11:15:25 PDT 2023


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


================
Comment at: bolt/lib/Profile/YAMLProfileReader.cpp:109
 
-  BinaryFunction::BasicBlockOrderType DFSOrder = BF.dfs();
+  SmallVector<BinaryBasicBlock *, 0> Order;
+  if (opts::ProfileUseDFS)
----------------
spupyrev wrote:
> Is there a reason why the type is not `BinaryFunction::BasicBlockOrderType` but an explicit SmallVector?
> 
> Also I'm not sure if there is any advantage here to use SmallVector over std::vector, as the order is always non-empty.
You're right, can just use that type alias. I thought to use a `SmallVector<const BinaryBasicBlock *, 0>` version in YAMLWriter but let's keep them uniform between reader and writer. Regarding std::vector: it used to be it, but Maksim changed to ADT type citing BinaryFunction size reduction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155514



More information about the llvm-commits mailing list