[PATCH] D66029: llvm-canon

Michal Paszkowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 18 12:48:58 PDT 2019


mpaszkowski added inline comments.


================
Comment at: tools/llvm-canon/canonicalizer.cpp:88
+        // Initialize to a random constant, so the state isn't zero.
+        uint64_t Hash = 0x6acaa36bef8325c5ULL;
+
----------------
fdeazeve wrote:
> plotfi wrote:
> > What is this magic number? Could this be generated with something like srand at the begining of runOnFunction? 
> I might be missing something, but don't we want this algorithm to produce the same result if it's run on the "same" (two identical functions, modulo renaming, etc) function twice in a row?
You are right, this number cannot be generated by srand. We want the canonicalization to be deterministic.


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

https://reviews.llvm.org/D66029





More information about the llvm-commits mailing list