<div dir="ltr">Hi,<div>I'm trying to get some information using sampling profile data to extract the program behavior. I'm using llvm 5.0.0.</div><div><br></div><div>I followed clang's documentation. I'm compiling my sources with -g, using perf record to collect the profiling info. I also used autofdo and converted the profiling data to LLVM's format.</div><div><br></div><div>I fed the profiling data to clang and compiled it into .ll file using -g -fprofile-sample=... I can see the profile summary. So I assume that I managed to collect the sample profiling data correctly. I somewhat figured out what the detailed summary means when I compared it against llvm-profdata's output.</div><div><br></div><div><div>!4 = !{i32 1, !"ProfileSummary", !5}</div><div>!5 = !{!6, !7, !8, !9, !10, !11, !12, !13}</div><div>!6 = !{!"ProfileFormat", !"SampleProfile"}</div><div>!7 = !{!"TotalCount", i64 269054785}</div><div>!8 = !{!"MaxCount", i64 406635}</div><div>!9 = !{!"MaxInternalCount", i64 0}</div><div>!10 = !{!"MaxFunctionCount", i64 435366}</div><div>!11 = !{!"NumCounts", i64 1538}</div><div>!12 = !{!"NumFunctions", i64 13}</div><div>!13 = !{!"DetailedSummary", !14}</div><div>!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30}</div><div>!15 = !{i32 10000, i64 406635, i32 17}</div><div>!16 = !{i32 100000, i64 406632, i32 92}</div><div>!17 = !{i32 200000, i64 384936, i32 135}</div><div>!18 = !{i32 300000, i64 365763, i32 223}</div><div>!19 = !{i32 400000, i64 365762, i32 282}</div><div>!20 = !{i32 500000, i64 365759, i32 359}</div><div>!21 = !{i32 600000, i64 250328, i32 451}</div><div>!22 = !{i32 700000, i64 216434, i32 569}</div><div>!23 = !{i32 800000, i64 213161, i32 697}</div><div>!24 = !{i32 900000, i64 196084, i32 822}</div><div>!25 = !{i32 950000, i64 95056, i32 892}</div><div>!26 = !{i32 990000, i64 86169, i32 1011}</div><div>!27 = !{i32 999000, i64 3734, i32 1074}</div><div>!28 = !{i32 999900, i64 494, i32 1271}</div><div>!29 = !{i32 999990, i64 125, i32 1358}</div><div>!30 = !{i32 999999, i64 12, i32 1390}</div><div>!31 = !{!"clang version 3.9.0 (tags/RELEASE_390/final 289411)"}</div><div>!32 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 92, type: !33, isLocal: false, isDefinition: true, scopeLine: 93, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)</div><div>!33 = !DISubroutineType(types: !2)</div><div>!34 = !{!"function_entry_count", i64 0}</div></div><div><br></div><div><br></div><div>My purpose is to see how the sample profile I collected using perf affects branch probability and block frequency info. So I used the sampling profile data with the .ll file that I compiled WITHOUT -fprofile-sample=...</div><div><br></div><div>I invoked opt like this:</div><div><div>opt -analyze -sample-profile-file="../bt.A.x_out" -block-freq  bt.ll</div></div><div>opt -analyze -sample-profile-file="../bt.A.x_out" -branch-prob  bt.ll<br></div><div><br></div><div>I see no difference in the outputs between when I use the sample profiling data and when I do the same analysis without the sample profiling data.</div><div><br></div><div>bt is from NPB suite (Serial, class A). </div><div><br></div><div>I'm kind of confused. I appreciate if somebody can comment on: </div><div>Am I doing something wrong or should I change my benchmark since this is not representative enough?</div><div><br></div><div><br></div><div>Thanks!</div><div><br></div><div>-- <br><div class="gmail-m_-4381944731005709249gmail_signature"><div dir="ltr">Buse</div></div>
</div></div>