<div dir="ltr"><div>Thank you Craig for explanation.</div><div><br></div><div>Could be the same algorithm used for custom legalizing given node in LowerOperation and
ReplaceNodeResults in case results and inputs of the node are illegal?</div><div>Or actually such situation is impossible and for given node either LowerOperation or
ReplaceNodeResults can be only called?</div><div><br></div><div>Przemek<br></div></div><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">wt., 28 sty 2020, 18:48 użytkownik Craig Topper <<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>> napisał:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="auto">ReplaceNodeResults is called by the type legalizer for custom legalizing any of the results of a node that have an illegal type.</div></div><div dir="auto"><br></div><div dir="auto">LowerOperation is called by the type legalizer to custom legalize node inputs that have an illegal type. I believe technically it calls LowerOperationWrapper, but that forwards to LowerOperation by default.</div><div dir="auto"><br></div><div dir="auto">LowerOperation is also called for custom legalizing nodes with legal types after type legalization by both the vector op legalizer and the DAG legalizer. In those cases LowerOperation is called directly and does not call LowerOperationWrapper.</div></div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2020 at 9:10 AM Przemyslaw Ossowski via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><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">
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">Hi,<span></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">I see that for different targets in classes which inherits
from TargetLowering there are implemented both methods:<span></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">LowerOperation and ReplaceNodeResults<span></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif"><span> </span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">What decides that for one given ISD we have to add handling
in LowerOperation and for other in ReplaceNodeResults, when for both SetOperationAction
is configured to be Custom?</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif"><br><span></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">Is it related with number of results of given operation
and LowerOperation is called when there is only one SDValue?<span></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif"><span> </span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">Thanks,<span></span></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">Przemek<span></span></p>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</div>-- <br><div dir="ltr">~Craig</div>
</blockquote></div></div></div>