Skip to content

Commit 8f469bf

Browse files
committed
[AArch64][ISel] NFC: Change streaming mode only through 'changeStreamingMode'
This simplifies the code and unifies code-paths to use a single function for emitting streaming-mode changes.
1 parent 1143da2 commit 8f469bf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6627,12 +6627,10 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
66276627
// make sure it is Glued to the last CopyFromReg value.
66286628
if (IsLocallyStreaming) {
66296629
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+
66366634
// Ensure that the SMSTART happens after the CopyWithChain such that its
66376635
// chain result is used.
66386636
for (unsigned I=0; I<InVals.size(); ++I) {
@@ -7884,11 +7882,9 @@ AArch64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
78847882
// Emit SMSTOP before returning from a locally streaming function
78857883
SMEAttrs FuncAttrs(MF.getFunction());
78867884
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);
78927888
Glue = Chain.getValue(1);
78937889
}
78947890

0 commit comments

Comments
 (0)