<div dir="ltr">You may want to read this discussion:<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-June/063010.html">http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-June/063010.html</a></div></blockquote><div><br></div><div>And look at how PNaCl declares its own target.</div><div><br></div><div>There are a few more references here:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><a href="https://developer.chrome.com/native-client/reference/pnacl-bitcode-abi">https://developer.chrome.com/native-client/reference/pnacl-bitcode-abi</a></div></blockquote></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 9, 2014 at 12:33 AM, Kuperstein, Michael M <span dir="ltr"><<a href="mailto:michael.m.kuperstein@intel.com" target="_blank">michael.m.kuperstein@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Hao,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You are right, the IR is not “target independent” in the strict sense.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">There’s a fairly old post that explains this (amongst other things) in detail:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043719.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043719.html</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">x86_fp80 is just one example of this.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">It is kind-of-possible to restrict LLVM IR to be sort-of-target-independent (look up Portable Native Client and SPIR for details), but an arbitrary IR file
 generated by a front-end that had target X in mind is not guaranteed to work as you’d expect if you use backend Y.<u></u><u></u></span></p>
<p class="MsoNormal"><a name="14a2e337ef3bffec__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Michael<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Hao Wang<br>
<b>Sent:</b> Tuesday, December 09, 2014 09:33<br>
<b>To:</b> <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br>
<b>Subject:</b> [LLVMdev] The target independence of IR<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="line-height:115%">Hi, <u></u><u></u></p>
<div>
<p class="MsoNormal" style="line-height:115%"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%">Can anyone help me understand that LLVM IR has "target independence" ?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%">1. When we talk about "target", we mean something like Instruction Set Architecture ?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%">2. The front-end may generate IR code such as x86_fp80, so the IR is actually not fully target-independent? It contains information about the target, and the front-end should also be aware of this?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%">Thank you!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="line-height:115%">Hao <u></u><u></u></p>
</div>
</div>
</div></div></div>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>