<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Christian,</div><div class=""><br class=""></div>I’m guessing you would want a mechanism similar to what we use for PGO (which I do not know how it works :)).<div class=""><br class=""></div><div class="">+ Justin who works on PGO.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Quentin<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 24, 2015, at 6:05 PM, Christian Convey <<a href="mailto:christian.convey@gmail.com" class="">christian.convey@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<div class=""><br class=""></div><div class="">Does anyone know of a good solution to the following? I'm trying to find a good way to stably associate distinct ID numbers with different BB in a module. As long as the module's IR hasn't changed in any way whatsoever, I'd like to be guaranteed to always generate the same ID <--> BB mapping. Or if the mapping is ambiguous, because two or more mappings between BB's and ID's are indistinguishable (isomorphic?), I'd like to be sure I at least can reliably re-obtain some mapping in that equivalence class.</div><div class=""><br class=""></div><div class="">This seems related to a <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D16043&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=VyhVlhie270AiA60rcYOf3Vw5xKKZFKAgr5GK6hPXu0&s=Kv0Xo7jx0HJ8mumCx_vW368qV5lXoVdMAygrhChMMFU&e=" class="">debate / bug-report</a> regarding the arbitrary nature of (pseudo?) labels in LLVM assembly. E.g.,<i class="">"; label:3"</i>. </div><div class=""><br class=""></div><div class="">It also looks like <i class="">llvm-diff</i> does something similar to what I want in its <i class="">FunctionDifferenceEngine</i> class. But I think <i class="">llvm-diff</i> allows for the two IR's to differ, and uses approximate matching. I don't need any graceful degradation when the IR has changed, but I need exact matching when the IR hasn't changed.</div><div class=""><br class=""></div><div class="">In the worst-case scenario, I could make a sweep through all of the module's BB's and just tag each BB with a distinct serial number in its metadata. But I'd like to avoid this if possible, partly because I'd like there to be a chance of the BB <--> ID mapping remaining valid if I run Clang.</div><div class=""><br class=""></div><div class="">Thanks, Christian</div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></div></div></body></html>