https://llvm.org/bugs/show_bug.cgi?id=28990
Bug ID: 28990 Summary: Incorrect sample profile when braces omitted Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: dcalla...@fb.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 16959 --> https://llvm.org/bugs/attachment.cgi?id=16959&action=edit script to demonstrate Attached are two source variables, bug1.cc and bug2.cc which differ only in the placement of braces around a then-statement. When these braces are omitted, a profile-based sample is incorrect while it is correct when they are present. Reproduction steps are in bug1.sh create_llvm_prof is available at https://github.com/google/autofdo The incorrect sample derived from bug1.cc (from llvm-profdata show) is: Function: _Z8clampSumPdidd: 100803968, 0, 13 sampled lines Samples collected in the function's body { 0: 0 1: 0 2.1: 908152 2.2: 908138 3: 908139 4: 0 5: 908146 6: 908142 7: 908150 9: 908149 10: 908146 11: 908138 13: 4 } while the correct sample derived from bug2.cc is Function: _Z8clampSumPdidd: 101434538, 1, 14 sampled lines Samples collected in the function's body { 0: 1 1: 1 2.1: 913831 2.2: 913817 3: 913818 4: 0 5: 913830 6: 913826 7: 0 8: 913834 9: 913831 10: 913827 11: 913821 13: 1 } where the key differences is the value for relative line 7, it should be 0. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs