[PATCH] D84782: [PGO] Include the mem ops into the function hash.

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 14:47:44 PDT 2020


yamauchi added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:623
 // Compute Hash value for the CFG: the lower 32 bits are CRC32 of the index
-// value of each BB in the CFG. The higher 32 bits record the number of edges.
+// value of each BB in the CFG. The higher 32 bits are the CR32 of the numbers
+// of selects, indirect calls, mem ops and edges.
----------------
MaskRay wrote:
> To make sure I understand: we use two CRCs instead of one CRC because we want to extract low/high 32 bits for debugging purposes?
> 
> Otherwise, we can just use one CRC.
JamCRC's result is 32-bit, but we have 64-bit (actually 60-bits) of spare room. Using more bits should decrease the chance of hash collisions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84782



More information about the llvm-commits mailing list