@@ -241,6 +241,8 @@ DPUTargetLowering::DPUTargetLowering(const TargetMachine &TM, DPUSubtarget &STI)
241
241
setOperationAction (ISD::VAEND, MVT::Other, Expand);
242
242
setOperationAction (ISD::VACOPY, MVT::Other, Expand);
243
243
244
+ setOperationAction (ISD::ADDRSPACECAST, MVT::i32, Custom);
245
+
244
246
for (MVT VT : MVT::integer_valuetypes ()) {
245
247
setLoadExtAction (ISD::EXTLOAD, VT, MVT::i1, Promote);
246
248
setLoadExtAction (ISD::ZEXTLOAD, VT, MVT::i1, Promote);
@@ -260,6 +262,9 @@ SDValue DPUTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
260
262
dbgs () << " \n " ;
261
263
});
262
264
switch (Op.getOpcode ()) {
265
+ case ISD::ADDRSPACECAST:
266
+ return LowerAddrSpaceCast (Op, DAG);
267
+
263
268
case ISD::MUL:
264
269
return LowerMultiplication (Op, DAG);
265
270
@@ -592,6 +597,16 @@ const char *DPUTargetLowering::getTargetNodeName(unsigned Opcode) const {
592
597
}
593
598
}
594
599
600
+ SDValue DPUTargetLowering::LowerAddrSpaceCast (SDValue Op, SelectionDAG &DAG) const {
601
+ const Function & Func = DAG.getMachineFunction ().getFunction ();
602
+ DiagnosticInfoUnsupported Diag (Func,
603
+ " Cast between addresses of different address space is not supported" ,
604
+ Op.getDebugLoc ());
605
+ Func.getContext ().diagnose (Diag);
606
+ report_fatal_error (" Cast between addresses of different address space is not supported" , false );
607
+ return Op;
608
+ }
609
+
595
610
SDValue DPUTargetLowering::LowerVASTART (SDValue Op, SelectionDAG &DAG) const {
596
611
SDLoc DL (Op);
597
612
SDValue Chain = Op.getOperand (0 );
0 commit comments