[all-commits] [llvm/llvm-project] 6b8d04: [CodeLayout] Refactor std::vector uses, namespace, ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Sep 21 13:13:17 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b8d04c23dbcc156c24c4152ac36eb6c384cb361
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

  Changed paths:
    M bolt/lib/Passes/ReorderAlgorithm.cpp
    M bolt/lib/Passes/ReorderFunctions.cpp
    M llvm/include/llvm/Transforms/Utils/CodeLayout.h
    M llvm/lib/CodeGen/MachineBlockPlacement.cpp
    M llvm/lib/Transforms/Utils/CodeLayout.cpp

  Log Message:
  [CodeLayout] Refactor std::vector uses, namespace, and EdgeCountT. NFC

* Place types and functions in the llvm::codelayout namespace
* Change EdgeCountT from pair<pair<uint64_t, uint64_t>, uint64_t> to a struct and utilize structured bindings.
  It is not conventional to use the "T" suffix for structure types.
* Remove a redundant copy in ChainT::merge.
* Change {ExtTSPImpl,CDSortImpl}::run to use return value instead of an output parameter
* Rename applyCDSLayout to computeCacheDirectedLayout: (a) avoid rare
  abbreviation "CDS" (cache-directed sort) (b) "compute" is more conventional
  for the specific use case
* Change the parameter types from std::vector to ArrayRef so that
  SmallVector arguments can be used.
* Similarly, rename applyExtTspLayout to computeExtTspLayout.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D159526

More information about the All-commits mailing list