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

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 15:31:44 PDT 2015


danielcdh added inline comments.

================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:245-246
@@ -234,4 +244,4 @@
 
-  ErrorOr<uint64_t> R =
-      FS->findSamplesAt(Lineno - HeaderLineno, DIL->getDiscriminator());
+  ErrorOr<uint64_t> R = FS->findSamplesAt(getOffset(Lineno, HeaderLineno),
+                                          DIL->getDiscriminator());
   if (R)
----------------
Done.

In create_llvm_prof, offset is only encoded in 16 bits.


http://reviews.llvm.org/D13914





More information about the llvm-commits mailing list