link getCopyToParts generated nodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

link getCopyToParts generated nodes

akshay_llvm
Hi all,

I am new to llvm so may not be able to describe problem correctly. So, please ask for extra details.
I have architecture that has only i64 leagal type.
So in getCopyToParts function to handle case with  ValueVT=f32 and PartVT=i64, I added following code:

if(ValueVT == EVT(MVT::f32) && PartVT == MVT::i64){
 SDValue IntMVal = DAG.getNode(ISD::FP_EXTEND, DL, MVT::f64, Val);
Val = DAG.getNode(ISD::BITCAST, DL, PartVT, IntMVal);
}

this function when called by void RegsForValue::getCopyToRegs gives no problem. But when called by SoftenFloatRes_FP_EXTEND(SDNode *N) while softening result ends up with operands not processed error for
CopyToReg node.

the sequence generated by my code in Optimzed Lowered Selection DAG:
          0x210f7d0: f64 = fp_extend 0x210e5b0 [ORD=4]

        0x210f3d0: i64 = bitcast 0x210f7d0 [ORD=4]

      0x210deb0: ch = CopyToReg 0x20d86e0, 0x21106e0, 0x210f3d0 [ORD=4]

And failed with :
Operand not processed?
0x210deb0: ch = CopyToReg 0x20d86e0, 0x21106e0, 0x2125d30 [ORD=4] [ID=1]

Clearly 3rd operand of CopyToReg is some garbage here. Don't how it changed.

Any help is appreciated.

Thanks,
Akshay.