<div dir="ltr">Thank you for the answer, you helped a lot!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-18 15:38 GMT+02:00 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 18 July 2017 at 03:09, Anastasiya Ruzhanskaya via llvm-dev<br>
<span class=""><<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> in some operations there is a ty2 type, for example in truncate. What is the<br>
> most right way to get it ? I have seen some EVT types, but this is connected<br>
> to DAG... and I don't believe that there is no easy way to get ty2 with one<br>
> call function.<br>
<br>
</span>For most operations you'll be looking at the type of the SDValue<br>
itself or one of its operands. This applies to trunc, where<br>
Op.getType() is the destination (small) type of the trunc and<br>
Op.getOperand(0).getType() is the source (big) type.<br>
<br>
The most common exception is sext_inreg nodes. They get created during<br>
legalization when it's realized that the source type doesn't have a<br>
valid register size; so both source and destination have the same type<br>
and there's a separate "this is the type you should extend from"<br>
operand. You'd access it with<br>
cast<VTSDnode>(Op.getOperand(<wbr>1))->getVT().<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>