<div dir="ltr">On Tue, Jul 2, 2013 at 8:16 PM, Matt Arsenault <span dir="ltr"><<a href="mailto:Matthew.Arsenault@amd.com" target="_blank">Matthew.Arsenault@amd.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reject bitcasts between address spaces with different sizes<br>
<br>
Autoupgrade from address space bitcasts in existing binaries<br>
to ptrtoint / inttoptr. This conversion does not happen for<br>
bitcasts between address spaces with the same pointer size for now.<br>
<br>
For bitcode, turn bitcasts from pointers to different address<br>
spaces into ptrtoint -> inttoptr to the different address space.<br>
<br>
For text IR, the module fails verification.<br>
<br>
This was discussed a while ago in this thread:<br>
<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053277.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053277.html</a><br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1083" target="_blank">http://llvm-reviews.chandlerc.com/D1083</a><br>
<br>
Files:<br>
  docs/LangRef.rst<br>
  include/llvm/AutoUpgrade.h<br>
  lib/AsmParser/LLParser.cpp<br>
  lib/Bitcode/Reader/BitcodeReader.cpp<br>
  lib/IR/AutoUpgrade.cpp<br>
  lib/IR/Verifier.cpp<br>
  test/Bitcode/bitcast-upgrade.ll<br>
  test/Bitcode/bitcast.ll<br><br></blockquote><div><br></div><div>High-level issues:<br><br></div><div>1. The way this is written, adding a data layout string to a module can turn a valid module into an invalid module.  We should consider introducing some sort of safe invariant here (either ban modules without data layouts outright, or don't allow them to use non-zero address spaces).<br>

</div><div>2. What are your long-term plans here?  I'm particularly worried about how you're planning on testing this.<br></div><div><br></div></div>
</div><div class="gmail_extra">-Eli</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 8:16 PM, Matt Arsenault <span dir="ltr"><<a href="mailto:Matthew.Arsenault@amd.com" target="_blank">Matthew.Arsenault@amd.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Reject bitcasts between address spaces with different sizes<br>
<br>
Autoupgrade from address space bitcasts in existing binaries<br>
to ptrtoint / inttoptr. This conversion does not happen for<br>
bitcasts between address spaces with the same pointer size for now.<br>
<br>
For bitcode, turn bitcasts from pointers to different address<br>
spaces into ptrtoint -> inttoptr to the different address space.<br>
<br>
For text IR, the module fails verification.<br>
<br>
This was discussed a while ago in this thread:<br>
<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053277.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053277.html</a><br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1083" target="_blank">http://llvm-reviews.chandlerc.com/D1083</a><br>
<br>
Files:<br>
  docs/LangRef.rst<br>
  include/llvm/AutoUpgrade.h<br>
  lib/AsmParser/LLParser.cpp<br>
  lib/Bitcode/Reader/BitcodeReader.cpp<br>
  lib/IR/AutoUpgrade.cpp<br>
  lib/IR/Verifier.cpp<br>
  test/Bitcode/bitcast-upgrade.ll<br>
  test/Bitcode/bitcast.ll<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>