<p dir="ltr">Matt, I thought about making this pass generic, but as written it doesn't make much sense if you don't follow it with the equivalent of the NVPTX address space inference pass.</p>
<p dir="ltr">David, I will meditate on this...</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 20, 2016 8:40 PM, "Matt Arsenault" <<a href="mailto:Matthew.Arsenault@amd.com">Matthew.Arsenault@amd.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">arsenm added a subscriber: arsenm.<br>
<br>
================<br>
Comment at: llvm/lib/Target/NVPTX/<wbr>NVPTXHoistAddrSpaceCast.cpp:<wbr>156-160<br>
@@ +155,7 @@<br>
+ if (AddrSpaceCastInst *ASC = dyn_cast<AddrSpaceCastInst>(&<wbr>I))<br>
+ if (ASC->getSrcAddressSpace() == AddressSpace::ADDRESS_SPACE_<wbr>GENERIC &&<br>
+ ASC->getDestAddressSpace() != AddressSpace::ADDRESS_SPACE_<wbr>GENERIC &&<br>
+ ASC->getSrcTy()-><wbr>getPointerElementType() ==<br>
+ ASC->getDestTy()-><wbr>getPointerElementType())<br>
+ Worklist.push_back(ASC);<br>
+<br>
----------------<br>
Can you put this into a TTI hook?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D23749" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23749</a><br>
<br>
<br>
<br>
</blockquote></div></div>