[PATCH] D36351: [lld][ELF] Add profile guided section layout

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 18:20:28 PDT 2018


espindola added inline comments.


================
Comment at: ELF/CallGraphSort.cpp:201
+
+    Sections[To].Weight = SaturatingAdd(Sections[To].Weight, Weight);
+
----------------
This is using SaturatingAdd on a uint64_t. That also seems like over engineering.

Each unit of edge weight comes from a sample during execution. Even with a compact format using a single byte per sample we would need 16 exbibytes for it to overflow. Where would such a sample have been stored?




https://reviews.llvm.org/D36351





More information about the llvm-commits mailing list