[PATCH] D113424: ext-tsp basic block layout

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 09:14:56 PST 2021


hoy added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3571
+  MachineBasicBlock *HeadBB = &F->front();
+  BlockChain *FunctionChain =
+      new (ChainAllocator.Allocate()) BlockChain(BlockToChain, HeadBB);
----------------
The object is created but not used anywhere. Is that expected?


================
Comment at: llvm/lib/Transforms/Utils/CodeLayout.cpp:110
+
+enum MergeTypeTy {
+  X_Y = 0,
----------------
nit: please use enum class and add comment for each enum value.


================
Comment at: llvm/lib/Transforms/Utils/CodeLayout.cpp:905
+  assert(NumNodes > 2 && "Incorrect input");
+  for (size_t Node = 0; Node < NumNodes; Node++) {
+    assert(NodeSizes.count(Node) > 0 && "Missing node size");
----------------
This is an assert-only loop. Put it under `#ifndef NDEBUG` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113424



More information about the llvm-commits mailing list