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
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.
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
Apparently Analagous Threads
- [LLVMdev] LegalizeDAG Error?
- [LLVMdev] [PATCH] Add new phase to legalization to handle vector operations
- [LLVMdev] [PATCH] Add new phase to legalization to handle vector operations
- [LLVMdev] [PATCH] Add new phase to legalization to handle vector operations
- [cfe-dev] FE_INEXACT being set for an exact conversion from float to unsigned long long