@@ -732,6 +732,18 @@ SDValue HexagonTargetLowering::LowerREADCYCLECOUNTER(SDValue Op,
732
732
return DAG.getNode (HexagonISD::READCYCLE, dl, VTs, Chain);
733
733
}
734
734
735
+ // Custom-handle ISD::READSTEADYCOUNTER because the target-independent SDNode
736
+ // is marked as having side-effects, while the register read on Hexagon does
737
+ // not have any. TableGen refuses to accept the direct pattern from that node
738
+ // to the A4_tfrcpp.
739
+ SDValue HexagonTargetLowering::LowerREADSTEADYCOUNTER (SDValue Op,
740
+ SelectionDAG &DAG) const {
741
+ SDValue Chain = Op.getOperand (0 );
742
+ SDLoc dl (Op);
743
+ SDVTList VTs = DAG.getVTList (MVT::i64 , MVT::Other);
744
+ return DAG.getNode (HexagonISD::READTIMER, dl, VTs, Chain);
745
+ }
746
+
735
747
SDValue HexagonTargetLowering::LowerINTRINSIC_VOID (SDValue Op,
736
748
SelectionDAG &DAG) const {
737
749
SDValue Chain = Op.getOperand (0 );
@@ -1507,6 +1519,7 @@ HexagonTargetLowering::HexagonTargetLowering(const TargetMachine &TM,
1507
1519
setOperationAction (ISD::INLINEASM_BR, MVT::Other, Custom);
1508
1520
setOperationAction (ISD::PREFETCH, MVT::Other, Custom);
1509
1521
setOperationAction (ISD::READCYCLECOUNTER, MVT::i64 , Custom);
1522
+ setOperationAction (ISD::READSTEADYCOUNTER, MVT::i64 , Custom);
1510
1523
setOperationAction (ISD::INTRINSIC_VOID, MVT::Other, Custom);
1511
1524
setOperationAction (ISD::EH_RETURN, MVT::Other, Custom);
1512
1525
setOperationAction (ISD::GLOBAL_OFFSET_TABLE, MVT::i32 , Custom);
@@ -1932,6 +1945,7 @@ const char* HexagonTargetLowering::getTargetNodeName(unsigned Opcode) const {
1932
1945
case HexagonISD::VINSERTW0: return " HexagonISD::VINSERTW0" ;
1933
1946
case HexagonISD::VROR: return " HexagonISD::VROR" ;
1934
1947
case HexagonISD::READCYCLE: return " HexagonISD::READCYCLE" ;
1948
+ case HexagonISD::READTIMER: return " HexagonISD::READTIMER" ;
1935
1949
case HexagonISD::PTRUE: return " HexagonISD::PTRUE" ;
1936
1950
case HexagonISD::PFALSE: return " HexagonISD::PFALSE" ;
1937
1951
case HexagonISD::D2P: return " HexagonISD::D2P" ;
@@ -3389,6 +3403,7 @@ HexagonTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
3389
3403
case ISD::INTRINSIC_VOID: return LowerINTRINSIC_VOID (Op, DAG);
3390
3404
case ISD::PREFETCH: return LowerPREFETCH (Op, DAG);
3391
3405
case ISD::READCYCLECOUNTER: return LowerREADCYCLECOUNTER (Op, DAG);
3406
+ case ISD::READSTEADYCOUNTER: return LowerREADSTEADYCOUNTER (Op, DAG);
3392
3407
break ;
3393
3408
}
3394
3409
0 commit comments