[LLVMdev] legalization of truncating stores in LegalizeDAG.cpp
Akira Hatanaka
ahatanak at gmail.com
Fri Jun 1 12:17:35 PDT 2012
Hi Duncan,
It seems that none of the current targets custom-lower truncating stores.
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.
I will add code in LegalizeDAG.cpp to check the returned value later.
On Fri, Jun 1, 2012 at 12:59 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Akira,
>
> On 01/06/12 02:27, Hatanaka, Akira wrote:
> > In LegalizeDAG.cpp, truncating stores are custom-lowered in line
> 1314-1317:
> >
> > 1314 case TargetLowering::Custom:
> > 1315 ReplaceNode(SDValue(Node, 0),
> > 1316 TLI.LowerOperation(SDValue(Node, 0), DAG));
> > 1317 break;
> >
> > Is there a reason it doesn't check whether the SDValue returned from
> > TargetLowering::LowerOperation is null before it replaces the original
> node with
> > the returned node? The return value is checked everywhere else
> > TLI.LowerOperation is called (line 937, for example).
> >
> >
> > 937 Tmp1 = TLI.LowerOperation(Tmp3, DAG);
> > 938 if (Tmp1.getNode()) {
> > 939 Tmp3 = Tmp1;
> > 940 Tmp4 = Tmp1.getValue(1);
> > 941 }
> > 942 break;
>
> probably it's just an oversight, because no backend needed it.
> LegalizeDAG is
> unfortunately full of code like this.
>
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120601/0e86ba62/attachment.html>
More information about the llvm-dev
mailing list