<div dir="ltr"><div>I have a CopyToReg that is moving a 16bit reg to a 32bit reg, it's currently being mapped out as a simple mov (not an ext), I would like to change that to an ext. It seemed that the SelDAG was the easiest and cleanest way to do this.</div><div><br></div><div>I can change the mov to an extension MI in the .td file; however, I can't tell at that point whether it's a sext or a zext, so it seemed the SelDAG was the better place to fix this.</div><div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 3:38 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">
<div text="#000000" bgcolor="#FFFFFF"><span>
<div>On 01/27/2015 12:28 PM, Ryan Taylor
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Thanks for getting back to me.</div>
<div><br>
</div>
<div>So those nodes record if the type has already been expanded
from a narrower type. Can you elaborate how I could use these
to help? Again, I'm pretty unfamiliar with the SDNodes.</div>
<div><br>
</div>
<div>Thanks.</div>
</div>
</blockquote></span>
What is the problem you are trying to solve? These should allow
SimplifyDemandedBits type optimizations understand that your copy
implicitly extended the source<span><br>
<br>
<br>
<br>
<blockquote type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jan 27, 2015 at 3:22 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:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div text="#000000" bgcolor="#FFFFFF">
<div>
<div>
<div>On 01/27/2015 12:16 PM, Ryan Taylor wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>I have a CopyToReg that is copying from
different size types, what's the best way to
change that to a zext or sext node based on
signed or unsigned? </div>
<div><br>
</div>
<div>I'm fairly unfamiliar with SelectionDAG
process (outside of the docs on llvm website).</div>
<div><br>
</div>
<div>It seems like I should be able to insert a
custom hook using the register class to identify
the type, potentially in ISelDAGToDag.cpp or is
there a better place for this to be done?</div>
<div><br>
</div>
<div>Thanks.</div>
</div>
<br>
</blockquote>
<br>
</div>
</div>
It sounds to me like you are looking for the AssertSext /
AssertZext nodes<span><font color="#888888"><br>
<br>
-Matt<br>
</font></span></div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</span></div>
</blockquote></div><br></div>