-/// BitcastLoad - Convert floating point loads to integer loads of the same
-/// type width and the bitcast the result back to a floating point type.
-SDValue AMDGPUTargetLowering::BitcastLOAD(SDValue Op, SelectionDAG &DAG) const
-{
- DebugLoc DL = Op.getDebugLoc();
- EVT VT = Op.getValueType();
- EVT IntVT;
-
- if (VT == MVT::f32) {
- IntVT = MVT::i32;
- } else if (VT == MVT::v4f32) {
- IntVT = MVT::v4i32;
- } else {
- return Op;
- }
- LoadSDNode * LD = dyn_cast<LoadSDNode>(Op);
- assert(LD);
-
- SDValue NewLoad = DAG.getLoad (LD->getAddressingMode(),
- LD->getExtensionType(), IntVT, DL,
- LD->getChain(), LD->getBasePtr(),
- LD->getOffset(), IntVT,
- LD->getMemOperand());
-
- SDValue Bitcast = DAG.getNode(ISD::BITCAST, DL, VT, NewLoad);
- DAG.ReplaceAllUsesWith(Op.getValue(0).getNode(), &Bitcast);
-
- return Op;
-}
-