[LLVMdev] LegalizeDAG Error?

Bill Wendling wendling at apple.com
Tue Dec 22 14:38:01 PST 2009


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?

-bw





More information about the llvm-dev mailing list