@@ -6627,12 +6627,10 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
6627
6627
// make sure it is Glued to the last CopyFromReg value.
6628
6628
if (IsLocallyStreaming) {
6629
6629
const AArch64RegisterInfo *TRI = Subtarget->getRegisterInfo();
6630
- Chain = DAG.getNode(
6631
- AArch64ISD::SMSTART, DL, DAG.getVTList(MVT::Other, MVT::Glue),
6632
- {DAG.getRoot(),
6633
- DAG.getTargetConstant((int32_t)AArch64SVCR::SVCRSM, DL, MVT::i32),
6634
- DAG.getConstant(0, DL, MVT::i64), DAG.getConstant(1, DL, MVT::i64),
6635
- DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask()), Glue});
6630
+ Chain =
6631
+ changeStreamingMode(DAG, DL, /*Enable*/ true, DAG.getRoot(), Glue,
6632
+ DAG.getConstant(0, DL, MVT::i64), /*Entry*/ true);
6633
+
6636
6634
// Ensure that the SMSTART happens after the CopyWithChain such that its
6637
6635
// chain result is used.
6638
6636
for (unsigned I=0; I<InVals.size(); ++I) {
@@ -7884,11 +7882,9 @@ AArch64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
7884
7882
// Emit SMSTOP before returning from a locally streaming function
7885
7883
SMEAttrs FuncAttrs(MF.getFunction());
7886
7884
if (FuncAttrs.hasStreamingBody() && !FuncAttrs.hasStreamingInterface()) {
7887
- Chain = DAG.getNode(
7888
- AArch64ISD::SMSTOP, DL, DAG.getVTList(MVT::Other, MVT::Glue), Chain,
7889
- DAG.getTargetConstant((int32_t)AArch64SVCR::SVCRSM, DL, MVT::i32),
7890
- DAG.getConstant(1, DL, MVT::i64), DAG.getConstant(0, DL, MVT::i64),
7891
- DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask()));
7885
+ Chain = changeStreamingMode(
7886
+ DAG, DL, /*Enable*/ false, Chain, /*Glue*/ SDValue(),
7887
+ DAG.getConstant(1, DL, MVT::i64), /*Entry*/ true);
7892
7888
Glue = Chain.getValue(1);
7893
7889
}
7894
7890
0 commit comments