<div dir="ltr"><div><div><div><div><div><div><div>Thanks, indeed it was on the LegalizeDAG.cpp and the information proved very useful.<br><br></div>I
 also realized that the customization, promotion or expansion will occur
 whenever any operand, with the same type as the type specified on the 
second argument (MVT) of setOperationAction function, appears. (Correct 
me if I'm wrong).<br><br></div>The second doubt I have regards instruction matching.<br><br></div>When I define a pattern such as:<br>[(set i32:$dst, (add (mul i32:$src1, i32:$src2), i32:$src3))]> <div><br></div>What is the meaning of the word "set" or "store" which appear quite often?<br></div>From what I can understand this pattern is only interest in an add node with a mul node as one operator and an immediate as the other.<br></div>Does the "set" (keyword?) translates to an output of the add node, or just another node?<br><br></div>Thanks,<br></div>Patosga</div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-06 6:22 GMT+01:00 Nemanja Ivanovic <span dir="ltr"><<a href="mailto:nemanja.i.ibm@gmail.com" target="_blank">nemanja.i.ibm@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br>Hi Patosga,<br></div>you can control what type the operands are promoted to as follows:<br>AddPromotedToType (ISD::ADD, MVT::i1, MVT::i64);<br><div class="gmail_extra"><br></div><div class="gmail_extra">For the "Expand" case, I believe you'll find what you're looking for in the file:<br>lib/CodeGen/SelectionDAG/LegalizeDAG.cpp<br></div><div class="gmail_extra">and function SelectionDAGLegalize::ExpandNode(), but if I'm wrong here perhaps others can correct me.<br><br></div><div class="gmail_extra">Finally, MVT::f32 just states that the operand is a 32-bit single precision floating point type.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra">Nemanja<br></div></font></span><div><div class="h5"><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Sun, Jun 5, 2016 at 11:05 PM, Pedro Lopes via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Sorry, glad I'm in the right place.<br></div><div>Before I start, I want to state that I'm a beginer and I'm trying to develop a backend by adapting an existent target to my platform. <br></div><div><br>My first doubt is about the SelectionDAG and the TargetLowering class.  When I use, for example:<br></div><div><tt><span>setOperationAction</span></tt><span>(</span><span>ISD</span><span>::</span><span>ADD</span><span>,</span> <span>MVT</span><span>::i1</span><span>,</span><span> Promote</span><span>);<br><br></span></div><div><span>Is it correct to say that I'm promoting any operand used by the ISD::ADD node to a larger type? If so, what would that value type be?<br><br></span></div><div><span>If I use the same function with the expand as the third argument like below:<br></span><tt><span>setOperationAction</span></tt><span>(</span><span>ISD</span><span>::</span><span>FSIN</span><span>,</span> <span>MVT</span><span>::</span><span>f32</span><span>,</span> <span>Expand</span><span>);</span><span><br>What will the 
expansion look like, since I don´t provide any custom implementation of 
the n</span><span>ode? Also, what is the meaning of the MVT::f32 in this case?<br><br></span></div><div><span>Thanks,<br></span></div><div><span>Patosga</span><tt><span></span></tt><span></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-05 19:16 GMT+01:00 Pierre Gagelin <span dir="ltr"><<a href="mailto:Pierre.Gagelin@myport.ac.uk" target="_blank">Pierre.Gagelin@myport.ac.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Hi Patosga,<br><br></div>You are on the right place to ask your questions and get help!<br><br>Try to be more specific with your problem. We need some details to help you =)<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Pierre<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 5 June 2016 at 18:12, via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello sir,<br>
<br>
I'm having some problems understading how llvm works. I'm following a concrete example and visualizing the DAG and the .s output and some stuff doesn´t seem to match.<br>
<br>
I sorry to bother you but I don´t know where I can expose my doubts and I wonder if you could redirect me to some discussion place where someone might help me.<br>
<br>
Thanks,<br>
Patosga<br>
<br>
_____________________________________<br>
Sent from <a href="http://llvm.1065342.n5.nabble.com" rel="noreferrer" target="_blank">http://llvm.1065342.n5.nabble.com</a><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br></div></div></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div>Cumprimentos,<br></div>José Pedro Lopes<br>------------------------------------<br></div>Best Regards,<br></div>José Pedro Lopes<br></div></div>
</div>