[llvm] 8f469bf - [AArch64][ISel] NFC: Change streaming mode only through 'changeStreamingMode'
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 06:37:52 PDT 2023
Author: Sander de Smalen
Date: 2023-08-31T13:36:38Z
New Revision: 8f469bfedc907a391da7207ba248afdb7e8c555d
URL: https://github.com/llvm/llvm-project/commit/8f469bfedc907a391da7207ba248afdb7e8c555d
DIFF: https://github.com/llvm/llvm-project/commit/8f469bfedc907a391da7207ba248afdb7e8c555d.diff
LOG: [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.
Added:
Modified:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 145e5c8173bb29..9217694f26601f 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -6627,12 +6627,10 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
// make sure it is Glued to the last CopyFromReg value.
if (IsLocallyStreaming) {
const AArch64RegisterInfo *TRI = Subtarget->getRegisterInfo();
- Chain = DAG.getNode(
- AArch64ISD::SMSTART, DL, DAG.getVTList(MVT::Other, MVT::Glue),
- {DAG.getRoot(),
- DAG.getTargetConstant((int32_t)AArch64SVCR::SVCRSM, DL, MVT::i32),
- DAG.getConstant(0, DL, MVT::i64), DAG.getConstant(1, DL, MVT::i64),
- DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask()), Glue});
+ Chain =
+ changeStreamingMode(DAG, DL, /*Enable*/ true, DAG.getRoot(), Glue,
+ DAG.getConstant(0, DL, MVT::i64), /*Entry*/ true);
+
// Ensure that the SMSTART happens after the CopyWithChain such that its
// chain result is used.
for (unsigned I=0; I<InVals.size(); ++I) {
@@ -7884,11 +7882,9 @@ AArch64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
// Emit SMSTOP before returning from a locally streaming function
SMEAttrs FuncAttrs(MF.getFunction());
if (FuncAttrs.hasStreamingBody() && !FuncAttrs.hasStreamingInterface()) {
- Chain = DAG.getNode(
- AArch64ISD::SMSTOP, DL, DAG.getVTList(MVT::Other, MVT::Glue), Chain,
- DAG.getTargetConstant((int32_t)AArch64SVCR::SVCRSM, DL, MVT::i32),
- DAG.getConstant(1, DL, MVT::i64), DAG.getConstant(0, DL, MVT::i64),
- DAG.getRegisterMask(TRI->getSMStartStopCallPreservedMask()));
+ Chain = changeStreamingMode(
+ DAG, DL, /*Enable*/ false, Chain, /*Glue*/ SDValue(),
+ DAG.getConstant(1, DL, MVT::i64), /*Entry*/ true);
Glue = Chain.getValue(1);
}
More information about the llvm-commits
mailing list