<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Alon, <div><br></div><div>There is no good mapping between IR-level instructions and MachineInstructions because we don’t do a 1:1 translation. We delete instructions and create new ones. Some of the memory operations hold references to the original IR pointer, but we drop this information in many places. We also delete or generate new basic blocks, so you can’t rely on that. However, from the MachineFunction you can access the original IR and access some metadata (which you can place on the terminator of the first basic block of something).  I am not sure how much information you want to communicate between the IR-level passes and the backend, but you can introduce new intrinsics that can be lowered to pseudo instructions.</div><div><br></div><div>Thanks,</div><div>Nadav  </div><div><br><div><div><div>On Aug 8, 2013, at 5:30 AM, Alon Shaltiel (ashaltie) <<a href="mailto:ashaltie@cisco.com">ashaltie@cisco.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Hi all,<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="">I'm looking for a way to insert metadata into an instruction/function/basic-block in the IR level, and afterwards reading it in the backend (ARM to be exact).<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style=""> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="">So my questions are:<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt;"><span style=""><span>1.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">      <span class="Apple-converted-space"> </span></span></span></span><span dir="LTR"></span><span style="">Does/can the metadata in the IR survive the code-generator in some way?<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -18pt;"><span style=""><span>2.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">      <span class="Apple-converted-space"> </span></span></span></span><span dir="LTR"></span><span style="">Is there a general of ‘communication’ between the optimizer and the backend?<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style=""> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="">Thanks!<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="">Alon<o:p></o:p></span></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" style="color: purple; text-decoration: underline;">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu/" style="color: purple; text-decoration: underline;">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color: purple; text-decoration: underline;">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></blockquote></div><br></div></div></body></html>