<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alex,<div class=""><br class=""></div><div class="">I’ve already pointed this out in <a href="https://reviews.llvm.org/D101538" class="">https://reviews.llvm.org/D101538</a>, but I suggest that you look at how DBG_VALUEs are generated. You may be able to design something that fit your needs by mimicking that or just piggybacking on the debug information.</div><div class=""><br class=""></div><div class="">See <a href="https://llvm.org/docs/SourceLevelDebugging.html#how-variable-location-metadata-is-transformed-during-codegen" class="">https://llvm.org/docs/SourceLevelDebugging.html#how-variable-location-metadata-is-transformed-during-codegen</a> for more details.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Quentin<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jul 19, 2021, at 8:13 AM, Bezzubikov, Aleksandr via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Gentle ping<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks,<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Alex<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Aleksandr Bezzubikov <<a href="mailto:zuban32s@gmail.com" class="">zuban32s@gmail.com</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, July 12, 2021 5:25 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>; <a href="mailto:quentin.colombet@gmail.com" class="">quentin.colombet@gmail.com</a>; <a href="mailto:jay.foad@gmail.com" class="">jay.foad@gmail.com</a>; <a href="mailto:Matthew.Arsenault@amd.com" class="">Matthew.Arsenault@amd.com</a><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Bezzubikov, Aleksandr <<a href="mailto:aleksandr.bezzubikov@intel.com" class="">aleksandr.bezzubikov@intel.com</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Querying IRTranslator value mapping results<o:p class=""></o:p></div></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi llvm-dev,<o:p class=""></o:p></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><p style="margin-right: 0in; margin-bottom: 9pt; margin-left: 0in;" class=""><span style="font-size: 10pt; font-family: "Segoe UI", sans-serif;" class="">I have the following problem - I want to generate a target instruction which denotes LLVM type of a value and its argument should be the value's vreg. Correct me if I'm wrong, the only stage I can do that at is IRTranslator since later we don't have any access to LLVM values at all, but IRTranslator's VMap is private and no other way to access such info exists.<o:p class=""></o:p></span></p><p style="margin-right: 0in; margin-bottom: 9pt; margin-left: 0in;" class=""><span style="font-size: 10pt; font-family: "Segoe UI", sans-serif;" class="">In this review<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/D101538" style="color: blue; text-decoration: underline;" class="">https://reviews.llvm.org/D101538</a><span class="Apple-converted-space"> </span>it was already discussed that overriding translate() methods is not good enough, can you suggest other ways of coping with that?<o:p class=""></o:p></span></p><p style="margin-right: 0in; margin-bottom: 9pt; margin-left: 0in;" class=""><span style="font-size: 10pt; font-family: "Segoe UI", sans-serif;" class="">I thought about extending GISelObserver with a new event, something like 'VRegCreated(Value*,VReg), what do you think? Or perhaps some TTI hook called within translate/getOrCreateVRegs.<o:p class=""></o:p></span></p><div style="margin: 0in;" class=""><span style="font-size: 10pt; font-family: "Segoe UI", sans-serif;" class="">I've tried approaches with target pseudo intrinsics and extra IR passes, but still everything depends on missing the external (relatively to the IRTranslator) way to obtain the info about Value->Vreg mapping.<o:p class=""></o:p></span></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks,<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Alex<o:p class=""></o:p></div></div></div></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">LLVM Developers mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></span></div></blockquote></div><br class=""></div></div></body></html>