Skip to content

Commit 9ddaf09

Browse files
committed
Fixups
1 parent 2427417 commit 9ddaf09

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8642,13 +8642,13 @@ static void analyzeCallOperands(const AArch64TargetLowering &TLI,
86428642
}
86438643

86448644
static SMECallAttrs
8645-
getSMECallAttrs(const Function &Function,
8645+
getSMECallAttrs(const Function &Caller,
86468646
const TargetLowering::CallLoweringInfo &CLI) {
86478647
if (CLI.CB)
86488648
return SMECallAttrs(*CLI.CB);
86498649
if (auto *ES = dyn_cast<ExternalSymbolSDNode>(CLI.Callee))
8650-
return SMECallAttrs(SMEAttrs(Function), SMEAttrs(ES->getSymbol()));
8651-
return SMECallAttrs(SMEAttrs(Function), SMEAttrs(SMEAttrs::Normal));
8650+
return SMECallAttrs(SMEAttrs(Caller), SMEAttrs(ES->getSymbol()));
8651+
return SMECallAttrs(SMEAttrs(Caller), SMEAttrs(SMEAttrs::Normal));
86528652
}
86538653

86548654
bool AArch64TargetLowering::isEligibleForTailCallOptimization(
@@ -8964,7 +8964,8 @@ static SDValue emitSMEStateSaveRestore(const AArch64TargetLowering &TLI,
89648964
return TLI.LowerCallTo(CLI).second;
89658965
}
89668966

8967-
static unsigned getSMCondition(const SMECallAttrs &CallAttrs) {
8967+
static AArch64SME::ToggleCondition
8968+
getSMToggleCondition(const SMECallAttrs &CallAttrs) {
89688969
if (!CallAttrs.caller().hasStreamingCompatibleInterface() ||
89698970
CallAttrs.caller().hasStreamingBody())
89708971
return AArch64SME::Always;
@@ -9473,9 +9474,9 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
94739474
InGlue = Chain.getValue(1);
94749475
}
94759476

9476-
SDValue NewChain =
9477-
changeStreamingMode(DAG, DL, CallAttrs.callee().hasStreamingInterface(),
9478-
Chain, InGlue, getSMCondition(CallAttrs), PStateSM);
9477+
SDValue NewChain = changeStreamingMode(
9478+
DAG, DL, CallAttrs.callee().hasStreamingInterface(), Chain, InGlue,
9479+
getSMToggleCondition(CallAttrs), PStateSM);
94799480
Chain = NewChain.getValue(0);
94809481
InGlue = NewChain.getValue(1);
94819482
}
@@ -9662,7 +9663,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
96629663
assert(PStateSM && "Expected a PStateSM to be set");
96639664
Result = changeStreamingMode(
96649665
DAG, DL, !CallAttrs.callee().hasStreamingInterface(), Result, InGlue,
9665-
getSMCondition(CallAttrs), PStateSM);
9666+
getSMToggleCondition(CallAttrs), PStateSM);
96669667

96679668
if (!Subtarget->isTargetDarwin() || Subtarget->hasSVE()) {
96689669
InGlue = Result.getValue(1);

llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void SMEAttrs::addKnownFunctionAttrs(StringRef FuncName) {
9090
if (FuncName == "__arm_sme_save" || FuncName == "__arm_sme_restore" ||
9191
FuncName == "__arm_sme_state_size")
9292
KnownAttrs |= SMEAttrs::SM_Compatible | SMEAttrs::SME_ABI_Routine;
93-
set(KnownAttrs, /*Enable=*/true);
93+
set(KnownAttrs);
9494
}
9595

9696
bool SMECallAttrs::requiresSMChange() const {

llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SMEAttrs {
4545
ZA_Mask = 0b111 << ZA_Shift,
4646
ZT0_Shift = 9,
4747
ZT0_Mask = 0b111 << ZT0_Shift,
48-
Callsite_Flags = ZT0_Undef
48+
CallSiteFlags_Mask = ZT0_Undef
4949
};
5050

5151
enum class InferAttrsFromName { No, Yes };
@@ -133,12 +133,12 @@ class SMEAttrs {
133133

134134
SMEAttrs operator|(SMEAttrs Other) const {
135135
SMEAttrs Merged(*this);
136-
Merged.set(Other.Bitmask, /*Enable=*/true);
136+
Merged.set(Other.Bitmask);
137137
return Merged;
138138
}
139139

140140
SMEAttrs withoutPerCallsiteFlags() const {
141-
return (Bitmask & ~Callsite_Flags);
141+
return (Bitmask & ~CallSiteFlags_Mask);
142142
}
143143

144144
bool operator==(SMEAttrs const &Other) const {

0 commit comments

Comments
 (0)