@@ -1487,39 +1487,6 @@ void AArch64DAGToDAGISel::SelectTable(SDNode *N, unsigned NumVecs, unsigned Opc,
14871487 ReplaceNode (N, CurDAG->getMachineNode (Opc, dl, VT, Ops));
14881488}
14891489
1490- static std::tuple<SDValue, SDValue>
1491- extractPtrauthBlendDiscriminators (SDValue Disc, SelectionDAG *DAG) {
1492- SDLoc DL (Disc);
1493- SDValue AddrDisc;
1494- SDValue ConstDisc;
1495-
1496- // If this is a blend, remember the constant and address discriminators.
1497- // Otherwise, it's either a constant discriminator, or a non-blended
1498- // address discriminator.
1499- if (Disc->getOpcode () == ISD::INTRINSIC_WO_CHAIN &&
1500- Disc->getConstantOperandVal (0 ) == Intrinsic::ptrauth_blend) {
1501- AddrDisc = Disc->getOperand (1 );
1502- ConstDisc = Disc->getOperand (2 );
1503- } else {
1504- ConstDisc = Disc;
1505- }
1506-
1507- // If the constant discriminator (either the blend RHS, or the entire
1508- // discriminator value) isn't a 16-bit constant, bail out, and let the
1509- // discriminator be computed separately.
1510- auto *ConstDiscN = dyn_cast<ConstantSDNode>(ConstDisc);
1511- if (!ConstDiscN || !isUInt<16 >(ConstDiscN->getZExtValue ()))
1512- return std::make_tuple (DAG->getTargetConstant (0 , DL, MVT::i64 ), Disc);
1513-
1514- // If there's no address discriminator, use XZR directly.
1515- if (!AddrDisc)
1516- AddrDisc = DAG->getRegister (AArch64::XZR, MVT::i64 );
1517-
1518- return std::make_tuple (
1519- DAG->getTargetConstant (ConstDiscN->getZExtValue (), DL, MVT::i64 ),
1520- AddrDisc);
1521- }
1522-
15231490void AArch64DAGToDAGISel::SelectPtrauthAuth (SDNode *N) {
15241491 SDLoc DL (N);
15251492 // IntrinsicID is operand #0
@@ -1530,13 +1497,11 @@ void AArch64DAGToDAGISel::SelectPtrauthAuth(SDNode *N) {
15301497 unsigned AUTKeyC = cast<ConstantSDNode>(AUTKey)->getZExtValue ();
15311498 AUTKey = CurDAG->getTargetConstant (AUTKeyC, DL, MVT::i64 );
15321499
1533- SDValue AUTAddrDisc, AUTConstDisc;
1534- std::tie (AUTConstDisc, AUTAddrDisc) =
1535- extractPtrauthBlendDiscriminators (AUTDisc, CurDAG);
1500+ SDValue Zero = CurDAG->getTargetConstant (0 , DL, MVT::i64 );
15361501
15371502 SDValue X16Copy = CurDAG->getCopyToReg (CurDAG->getEntryNode (), DL,
15381503 AArch64::X16, Val, SDValue ());
1539- SDValue Ops[] = {AUTKey, AUTConstDisc, AUTAddrDisc , X16Copy.getValue (1 )};
1504+ SDValue Ops[] = {AUTKey, Zero, AUTDisc , X16Copy.getValue (1 )};
15401505
15411506 SDNode *AUT = CurDAG->getMachineNode (AArch64::AUT, DL, MVT::i64 , Ops);
15421507 ReplaceNode (N, AUT);
@@ -1557,19 +1522,13 @@ void AArch64DAGToDAGISel::SelectPtrauthResign(SDNode *N) {
15571522 AUTKey = CurDAG->getTargetConstant (AUTKeyC, DL, MVT::i64 );
15581523 PACKey = CurDAG->getTargetConstant (PACKeyC, DL, MVT::i64 );
15591524
1560- SDValue AUTAddrDisc, AUTConstDisc;
1561- std::tie (AUTConstDisc, AUTAddrDisc) =
1562- extractPtrauthBlendDiscriminators (AUTDisc, CurDAG);
1563-
1564- SDValue PACAddrDisc, PACConstDisc;
1565- std::tie (PACConstDisc, PACAddrDisc) =
1566- extractPtrauthBlendDiscriminators (PACDisc, CurDAG);
1525+ SDValue Zero = CurDAG->getTargetConstant (0 , DL, MVT::i64 );
15671526
15681527 SDValue X16Copy = CurDAG->getCopyToReg (CurDAG->getEntryNode (), DL,
15691528 AArch64::X16, Val, SDValue ());
15701529
1571- SDValue Ops[] = {AUTKey, AUTConstDisc, AUTAddrDisc, PACKey,
1572- PACConstDisc, PACAddrDisc, X16Copy.getValue (1 )};
1530+ SDValue Ops[] = {
1531+ AUTKey, Zero, AUTDisc, PACKey, Zero, PACDisc, X16Copy.getValue (1 )};
15731532
15741533 SDNode *AUTPAC = CurDAG->getMachineNode (AArch64::AUTPAC, DL, MVT::i64 , Ops);
15751534 ReplaceNode (N, AUTPAC);
0 commit comments