[LLVMdev] LegalizeDAG Error?

Dale Johannesen dalej at apple.com
Tue Dec 22 14:46:32 PST 2009


On Dec 22, 2009, at 2:38 PMPST, Bill Wendling wrote:

> The LegalizeDAG.cpp file has this code in  
> SelectionDAGLegalize::PromoteNode:
>
>  case ISD::BSWAP: {
>    unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
>    Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Tmp1);
>    Tmp1 = DAG.getNode(ISD::BSWAP, dl, NVT, Tmp1);
>    Tmp1 = DAG.getNode(ISD::SRL, dl, NVT, Tmp1,
>                       DAG.getConstant(DiffBits,  
> TLI.getShiftAmountTy()));
>    Results.push_back(Tmp1);
>    break;
>  }
>
> Notice the first DAG.getNode() call. It's using "Tmp1", which at  
> this point isn't initialized. What should it be instead?

Node->getOperand(0) , probably, try it.  Nice catch.




More information about the llvm-dev mailing list