@@ -26926,6 +26926,23 @@ static SDValue performSHLCombine(SDNode *N,
26926
26926
return DAG.getNode(ISD::AND, DL, VT, NewShift, NewRHS);
26927
26927
}
26928
26928
26929
+ static SDValue performRNDRCombine(SDNode *N, SelectionDAG &DAG) {
26930
+ unsigned IntrinsicID = N->getConstantOperandVal(1);
26931
+ auto Register =
26932
+ (IntrinsicID == Intrinsic::aarch64_rndr ? AArch64SysReg::RNDR
26933
+ : AArch64SysReg::RNDRRS);
26934
+ SDLoc DL(N);
26935
+ SDValue A = DAG.getNode(
26936
+ AArch64ISD::MRS, DL, DAG.getVTList(MVT::i64, FlagsVT, MVT::Other),
26937
+ N->getOperand(0), DAG.getConstant(Register, DL, MVT::i32));
26938
+ SDValue B = DAG.getNode(
26939
+ AArch64ISD::CSINC, DL, MVT::i32, DAG.getConstant(0, DL, MVT::i32),
26940
+ DAG.getConstant(0, DL, MVT::i32),
26941
+ DAG.getConstant(AArch64CC::NE, DL, MVT::i32), A.getValue(1));
26942
+ return DAG.getMergeValues(
26943
+ {A, DAG.getZExtOrTrunc(B, DL, MVT::i1), A.getValue(2)}, DL);
26944
+ }
26945
+
26929
26946
SDValue AArch64TargetLowering::PerformDAGCombine(SDNode *N,
26930
26947
DAGCombinerInfo &DCI) const {
26931
26948
SelectionDAG &DAG = DCI.DAG;
@@ -27241,22 +27258,8 @@ SDValue AArch64TargetLowering::PerformDAGCombine(SDNode *N,
27241
27258
case Intrinsic::aarch64_sve_st1_scatter_scalar_offset:
27242
27259
return performScatterStoreCombine(N, DAG, AArch64ISD::SST1_IMM_PRED);
27243
27260
case Intrinsic::aarch64_rndr:
27244
- case Intrinsic::aarch64_rndrrs: {
27245
- unsigned IntrinsicID = N->getConstantOperandVal(1);
27246
- auto Register =
27247
- (IntrinsicID == Intrinsic::aarch64_rndr ? AArch64SysReg::RNDR
27248
- : AArch64SysReg::RNDRRS);
27249
- SDLoc DL(N);
27250
- SDValue A = DAG.getNode(
27251
- AArch64ISD::MRS, DL, DAG.getVTList(MVT::i64, FlagsVT, MVT::Other),
27252
- N->getOperand(0), DAG.getConstant(Register, DL, MVT::i32));
27253
- SDValue B = DAG.getNode(
27254
- AArch64ISD::CSINC, DL, MVT::i32, DAG.getConstant(0, DL, MVT::i32),
27255
- DAG.getConstant(0, DL, MVT::i32),
27256
- DAG.getConstant(AArch64CC::NE, DL, MVT::i32), A.getValue(1));
27257
- return DAG.getMergeValues(
27258
- {A, DAG.getZExtOrTrunc(B, DL, MVT::i1), A.getValue(2)}, DL);
27259
- }
27261
+ case Intrinsic::aarch64_rndrrs:
27262
+ return performRNDRCombine(N, DAG);
27260
27263
case Intrinsic::aarch64_sme_ldr_zt:
27261
27264
return DAG.getNode(AArch64ISD::RESTORE_ZT, SDLoc(N),
27262
27265
DAG.getVTList(MVT::Other), N->getOperand(0),
0 commit comments