Hi Duncan,<br><br>It seems that none of the current targets custom-lower truncating stores.<br><br>When I added code to do custom-lowering in the Mips backend, the original node gets removed if LowerOperation returns SDValue(). This resulted in an assertion raised when DAGCombiner::visitTokenFactor was executed.<br>
<br>I will add code in LegalizeDAG.cpp to check the returned value later.<br><br><div class="gmail_quote">On Fri, Jun 1, 2012 at 12:59 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Akira,<br>
<div><div class="h5"><br>
On 01/06/12 02:27, Hatanaka, Akira wrote:<br>
> In LegalizeDAG.cpp, truncating stores are custom-lowered in line 1314-1317:<br>
><br>
> 1314         case TargetLowering::Custom:<br>
> 1315           ReplaceNode(SDValue(Node, 0),<br>
> 1316                       TLI.LowerOperation(SDValue(Node, 0), DAG));<br>
> 1317           break;<br>
><br>
> Is there a reason it doesn't check whether the SDValue returned from<br>
> TargetLowering::LowerOperation is null before it replaces the original node with<br>
> the returned node? The return value is checked everywhere else<br>
> TLI.LowerOperation is called (line 937, for example).<br>
><br>
><br>
> 937         Tmp1 = TLI.LowerOperation(Tmp3, DAG);<br>
> 938         if (Tmp1.getNode()) {<br>
> 939           Tmp3 = Tmp1;<br>
> 940           Tmp4 = Tmp1.getValue(1);<br>
> 941         }<br>
> 942         break;<br>
<br>
</div></div>probably it's just an oversight, because no backend needed it.  LegalizeDAG is<br>
unfortunately full of code like this.<br>
<br>
Ciao, Duncan.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br>