[LLVMdev] LegalizeDAG Error?
Bill Wendling
wendling at apple.com
Tue Dec 22 14:47:49 PST 2009
On Dec 22, 2009, at 2:46 PM, Dale Johannesen wrote:
> 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.
>
Sounds reasonable to me. I'll check in the change. :-)
Thanks
-bw
More information about the llvm-dev
mailing list