[PATCH] D13914: Tolerate negative offset when matching sample profile.

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 16:26:25 PDT 2015


danielcdh added inline comments.

================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:186
@@ +185,3 @@
+unsigned SampleProfileLoader::getOffset(unsigned L, unsigned H) const {
+  return (L - H) & 0xffff;
+}
----------------
Added sanity check for LineLocation in text and binary reader. For gcov reader, the reader itself use bit operation to set LineLocation, which ensures that it's always within 16 bits.


http://reviews.llvm.org/D13914





More information about the llvm-commits mailing list