<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 31, 2018 at 8:39 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Michael Spencer <<a href="mailto:bigcheesegs@gmail.com">bigcheesegs@gmail.com</a>> writes:<br>
<br>
>> And you should be able to reproduce the non determinism.<br>
>><br>
><br>
> Looking into this.<br>
<br>
</span>Thanks.<br></blockquote><div><br></div><div>attached is an updated patch. Here's the diff from the last patch:</div><div><br></div><div><div>diff --git a/ELF/CallGraphSort.cpp b/ELF/CallGraphSort.cpp</div><div>index 64d4c23..bb935de 100644</div><div>--- a/ELF/CallGraphSort.cpp</div><div>+++ b/ELF/CallGraphSort.cpp</div><div>@@ -145,7 +145,7 @@ bool Edge::operator<(const Edge Other) const {</div><div> // Symbols, and generate a graph between InputSections with the provided</div><div> // weights.</div><div> CallGraphSort::CallGraphSort() {</div><div>- DenseMap<std::pair<const Symbol *, const Symbol *>, uint64_t> &Profile =</div><div>+ MapVector<std::pair<const Symbol *, const Symbol *>, uint64_t> &Profile =</div><div> Config->CallGraphProfile;</div><div> DenseMap<const InputSectionBase *, NodeIndex> SecToNode;</div><div> DenseMap<Edge, EdgeIndex, EdgeDenseMapInfo> EdgeMap;</div><div>diff --git a/ELF/Config.h b/ELF/Config.h</div><div>index 63f5818..6361d2b 100644</div><div>--- a/ELF/Config.h</div><div>+++ b/ELF/Config.h</div><div>@@ -106,7 +106,7 @@ struct Configuration {</div><div> std::vector<SymbolVersion> VersionScriptGlobals;</div><div> std::vector<SymbolVersion> VersionScriptLocals;</div><div> std::vector<uint8_t> BuildIdVector;</div><div>- llvm::DenseMap<std::pair<const Symbol *, const Symbol *>, uint64_t></div><div>+ llvm::MapVector<std::pair<const Symbol *, const Symbol *>, uint64_t></div><div> CallGraphProfile;</div><div> bool AllowMultipleDefinition;</div><div> bool AndroidPackDynRelocs = false;</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
>> Another thing I noticed that the vertices of hottest edge in the<br>
>> callgrpah is not close to each other in the output:<br>
>><br>
>> 1026: 00000000017c3770 246 FUNC LOCAL DEFAULT 9 _<br>
>> ZL15compRelocationsIN4llvm6obj<wbr>ect7ELFTypeILNS0_<br>
>> 7support10endiannessE1ELb1EEEN<wbr>S1_12Elf_Rel_ImplIS5_<wbr>Lb1EEEEbRKT0_SA_<br>
>> 41309: 0000000003235e60 838 FUNC WEAK DEFAULT 9<br>
>> _ZSt17__merge_sort_<wbr>loopIPN4llvm6object12Elf_Rel_<wbr>ImplINS1_7ELFTypeILNS0_<br>
>> 7support10endiannessE1ELb1EEEL<wbr>b1EEES8_lN9__gnu_cxx5__ops15_<br>
>> Iter_comp_iterIPFbRKS7_SD_<wbr>EEEEvT_SH_T0_T1_T2_<br>
>><br>
>> Cheers,<br>
>> Rafael<br>
>><br>
><br>
> That's because it couldn't find _<wbr>ZL15compRelocationsIN4llvm6obj<br>
> ect7ELFTypeILNS0_<wbr>7support10endiannessE1ELb1EEEN<wbr>S1_12Elf_Rel_ImplIS5_<wbr>Lb1EEEEbRKT0_SA_<br>
> in the symbol table as it's a local symbol. This isn't a problem for the<br>
> llvm based approach as it doesn't need to look up symbols.<br>
<br>
</span>Oops. I will fix this part tomorrow.<br>
<br>
BTW, another thing that the patch is missing is better tests. Could you<br>
add the example used in the paper?<br></blockquote><div><br></div><div>Sure.</div><div>
<br class="gmail-Apple-interchange-newline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">- Michael Spencer</span>
<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>