[PATCH] D54175: [PGO] context sensitive PGO

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 21:00:27 PDT 2019


pcc added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:673
+  // Reserve bit 60-63 for other information purpose.
+  FunctionHash &= 0x0FFFFFFFFFFFFFFF;
+  if (IsCS)
----------------
Hi Rong, I discovered a problem with this line of code. If the number of select instructions when the profile was collected differs by a multiple of 16 from the number when the profile is used, we get a hash collision which results in us hitting an assertion here:
http://llvm-cs.pcc.me.uk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#1042

Granted, the same problem seems to have already existed for differences that are multiples of 256, but this seems to make the problem more likely to occur.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54175





More information about the llvm-commits mailing list