[PATCH] D152833: A new code layout algorithm for function reordering [1/3]

Sergey Pupyrev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 15:22:06 PDT 2023


spupyrev added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeLayout.cpp:161
+/// together with the corresponding merge 'type' and 'offset'.
+struct MergeGainT {
+  explicit MergeGainT() = default;
----------------
hoy wrote:
> nit: by convention the `T` in the struct name is not needed. I'm seeing `JumpT` and a few other types getting `T`. Is there a particular reason?
I too don't like this T suffix but I found myself writing
```
    for (Chain *Chain : SortedChains)
```
all over the place. It compiles but looks confusing. I strongly prefer `ChainT *Chain` over this instead.

Any other suggestions?


================
Comment at: llvm/lib/Transforms/Utils/CodeLayout.cpp:991
+std::vector<uint64_t>
+llvm::applyExtTspLayout(const std::vector<uint64_t> &NodeSizes,
+                        const std::vector<uint64_t> &NodeCounts,
----------------
hoy wrote:
> I guess CDS is only for function layout, but do you think the name here should be adjusted in order to not be Exstsp-specific?
Can you clarify what "name" you refer to? (happy to rename or add a comment if there is a confusion)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152833



More information about the llvm-commits mailing list