[llvm-dev] getMachineNode() returns the same SDNode over and over again due to CSE in the instruction selection phase

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 11 11:58:33 PST 2017


On 1/11/2017 11:50 AM, Alex Susu via llvm-dev wrote:
>   Hello.
>     This is less a question but more a solution to a problem I 
> encountered yesterday. Still, if you have any comments please don't 
> hesitate to give feedback.
>
>     In my research processor back end, in [Target]ISelDAGToDAG.cpp I 
> give in method Select():
>       SDNode *vloadSpecial = CurDAG->getMachineNode(
> Connex::VLOAD_D_WO_IMM,
>                                              TYPE_VECTOR, // problems 
> with CSE
> //CurDAG->getVTList(TYPE_VECTOR, MVT::Glue),
>                                                               // NO 
> problems with CSE
> CurDAG->getEntryNode() // We add a chain edge
>                                              );
>      But this getMachineNode() call returns the same SDNode over and 
> over again in the same basic block due to CSE in the instruction 
> selection phase, since the machine node doesn't take any actual inputs.

If this node getting CSE'ed is a problem, CurDAG->getEntryNode() is 
probably not the right chain.  If you're replacing an existing node, you 
should use the same chain that node used.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list