diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/R600/AMDGPUISelLowering.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/Target/R600/SIISelLowering.cpp | 15 | 
2 files changed, 25 insertions, 4 deletions
| diff --git a/llvm/lib/Target/R600/AMDGPUISelLowering.cpp b/llvm/lib/Target/R600/AMDGPUISelLowering.cpp index 523ea10a976..b87a06e9344 100644 --- a/llvm/lib/Target/R600/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/R600/AMDGPUISelLowering.cpp @@ -776,6 +776,20 @@ SDValue AMDGPUTargetLowering::LowerLOAD(SDValue Op, SelectionDAG &DAG) const {      return DAG.getNode(ISD::getExtForLoadExtType(ExtType), DL, VT, ExtLoad32);    } +  if (ExtType == ISD::NON_EXTLOAD && VT.getSizeInBits() < 32) { +    assert(VT == MVT::i1 && "Only i1 non-extloads expected"); +    // FIXME: Copied from PPC +    // First, load into 32 bits, then truncate to 1 bit. + +    SDValue Chain = Load->getChain(); +    SDValue BasePtr = Load->getBasePtr(); +    MachineMemOperand *MMO = Load->getMemOperand(); + +    SDValue NewLD = DAG.getExtLoad(ISD::EXTLOAD, DL, MVT::i32, Chain, +                                   BasePtr, MVT::i8, MMO); +    return DAG.getNode(ISD::TRUNCATE, DL, VT, NewLD); +  } +    // Lower loads constant address space global variable loads    if (Load->getAddressSpace() == AMDGPUAS::CONSTANT_ADDRESS &&        isa<GlobalVariable>( diff --git a/llvm/lib/Target/R600/SIISelLowering.cpp b/llvm/lib/Target/R600/SIISelLowering.cpp index d08156f7f98..223e076d151 100644 --- a/llvm/lib/Target/R600/SIISelLowering.cpp +++ b/llvm/lib/Target/R600/SIISelLowering.cpp @@ -126,19 +126,24 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :    setOperationAction(ISD::INTRINSIC_VOID, MVT::Other, Custom); -  setLoadExtAction(ISD::SEXTLOAD, MVT::i32, Expand); +  setLoadExtAction(ISD::SEXTLOAD, MVT::i1, Promote);    setLoadExtAction(ISD::SEXTLOAD, MVT::i8, Custom);    setLoadExtAction(ISD::SEXTLOAD, MVT::i16, Custom); -  setLoadExtAction(ISD::ZEXTLOAD, MVT::i32, Expand); -  setLoadExtAction(ISD::ZEXTLOAD, MVT::i8, Custom); -  setLoadExtAction(ISD::ZEXTLOAD, MVT::i16, Custom); +  setLoadExtAction(ISD::SEXTLOAD, MVT::i32, Expand);    setLoadExtAction(ISD::SEXTLOAD, MVT::v8i16, Expand);    setLoadExtAction(ISD::SEXTLOAD, MVT::v16i16, Expand); +  setLoadExtAction(ISD::ZEXTLOAD, MVT::i1, Promote); +  setLoadExtAction(ISD::ZEXTLOAD, MVT::i8, Custom); +  setLoadExtAction(ISD::ZEXTLOAD, MVT::i16, Custom); +  setLoadExtAction(ISD::ZEXTLOAD, MVT::i32, Expand); + +  setLoadExtAction(ISD::EXTLOAD, MVT::i1, Promote);    setLoadExtAction(ISD::EXTLOAD, MVT::i8, Custom);    setLoadExtAction(ISD::EXTLOAD, MVT::i16, Custom);    setLoadExtAction(ISD::EXTLOAD, MVT::i32, Expand);    setLoadExtAction(ISD::EXTLOAD, MVT::f32, Expand); +    setTruncStoreAction(MVT::i32, MVT::i8, Custom);    setTruncStoreAction(MVT::i32, MVT::i16, Custom);    setTruncStoreAction(MVT::f64, MVT::f32, Expand); @@ -147,6 +152,8 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :    setTruncStoreAction(MVT::v8i32, MVT::v8i16, Expand);    setTruncStoreAction(MVT::v16i32, MVT::v16i16, Expand); +  setOperationAction(ISD::LOAD, MVT::i1, Custom); +    setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);    setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);    setOperationAction(ISD::FrameIndex, MVT::i32, Custom); | 

