Skip to content

Commit 71d9c99

Browse files
committed
[AArch64][MIR] Serialize AArch64FunctionInfo::HasStreamingModeChanges to MIR
This patch adds serialization of AArch64FunctionInfo::HasStreamingModeChanges into MIR.
1 parent 885d416 commit 71d9c99

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ yaml::AArch64FunctionInfo::AArch64FunctionInfo(
4040
getSVEStackSize(MFI, &llvm::AArch64FunctionInfo::getStackSizePPR)),
4141
HasStackFrame(MFI.hasStackFrame()
4242
? std::optional<bool>(MFI.hasStackFrame())
43-
: std::nullopt) {}
43+
: std::nullopt),
44+
HasStreamingModeChanges(
45+
MFI.hasStreamingModeChanges()
46+
? std::optional<bool>(MFI.hasStreamingModeChanges())
47+
: std::nullopt) {}
4448

4549
void yaml::AArch64FunctionInfo::mappingImpl(yaml::IO &YamlIO) {
4650
MappingTraits<AArch64FunctionInfo>::mapping(YamlIO, *this);
@@ -55,6 +59,8 @@ void AArch64FunctionInfo::initializeBaseYamlFields(
5559
YamlMFI.StackSizePPR.value_or(0));
5660
if (YamlMFI.HasStackFrame)
5761
setHasStackFrame(*YamlMFI.HasStackFrame);
62+
if (YamlMFI.HasStreamingModeChanges)
63+
setHasStreamingModeChanges(*YamlMFI.HasStreamingModeChanges);
5864
}
5965

6066
static std::pair<bool, bool> GetSignReturnAddress(const Function &F) {

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ struct AArch64FunctionInfo final : public yaml::MachineFunctionInfo {
645645
std::optional<uint64_t> StackSizeZPR;
646646
std::optional<uint64_t> StackSizePPR;
647647
std::optional<bool> HasStackFrame;
648+
std::optional<bool> HasStreamingModeChanges;
648649

649650
AArch64FunctionInfo() = default;
650651
AArch64FunctionInfo(const llvm::AArch64FunctionInfo &MFI);
@@ -659,6 +660,7 @@ template <> struct MappingTraits<AArch64FunctionInfo> {
659660
YamlIO.mapOptional("stackSizeZPR", MFI.StackSizeZPR);
660661
YamlIO.mapOptional("stackSizePPR", MFI.StackSizePPR);
661662
YamlIO.mapOptional("hasStackFrame", MFI.HasStackFrame);
663+
YamlIO.mapOptional("hasStreamingModeChanges", MFI.HasStreamingModeChanges);
662664
}
663665
};
664666

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; RUN: llc -mtriple=aarch64 -mattr=+sme -stop-after=aarch64-isel < %s | FileCheck %s
2+
3+
target triple = "aarch64"
4+
5+
declare void @foo() "aarch64_pstate_sm_enabled"
6+
7+
define dso_local void @bar() local_unnamed_addr {
8+
; CHECK-LABEL: name: bar
9+
; CHECK: hasStreamingModeChanges: true
10+
entry:
11+
tail call void @foo() "aarch64_pstate_sm_enabled"
12+
ret void
13+
}

0 commit comments

Comments
 (0)