[PATCH] D128093: [lld-macho] Initial support for Linker Optimization Hints

Noel Grandin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 11:03:35 PDT 2022


grandinj added inline comments.


================
Comment at: lld/MachO/Relocations.h:84
+  // The offsets from the start of the subsection that this hint applies to.
+  uint64_t offsets[3];
+  // The smallest of the above offsets.
----------------
(*) offsets[2] is never used, so it looks like this array can drop the 3rd element.

(*) I suspect it may in fact be cheaper to drop the minOffset field, and make it be a member function that calculates the minimum each time, since the code that touches this is likely to be dominated by cache-hit ratio, and making this structure smaller will increase that ratio, but you'd have to benchmark that.

(*) which brings me to - are these offsets completely independent of each other, or could they be expressed, for example, as
    uint64_t offset_base
    uint32_t offset_offsets[2]; // add this to offset_base to get the actual offset
possibly? Which would further increase cache density.




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

https://reviews.llvm.org/D128093



More information about the llvm-commits mailing list