Skip to content

Commit 339b042

Browse files
committed
Address review comments
Change-Id: I8b50f54a8eab9e78ef40c8002eb1768cb8e0bdb7
1 parent 031f8d4 commit 339b042

File tree

5 files changed

+161
-142
lines changed

5 files changed

+161
-142
lines changed

llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,11 +1018,9 @@ AArch64ExpandPseudo::expandCommitOrRestoreZA(MachineBasicBlock &MBB,
10181018
// Replace the pseudo with a call (BL).
10191019
MachineInstrBuilder MIB =
10201020
BuildMI(*SMBB, SMBB->end(), DL, TII->get(AArch64::BL));
1021-
unsigned FirstBLOperand = 1;
1022-
if (IsRestoreZA) {
1021+
if (IsRestoreZA)
10231022
MIB.addReg(MI.getOperand(1).getReg(), RegState::Implicit);
1024-
FirstBLOperand = 2;
1025-
}
1023+
unsigned FirstBLOperand = IsRestoreZA ? 2 : 1;
10261024
for (unsigned I = FirstBLOperand; I < MI.getNumOperands(); ++I)
10271025
MIB.add(MI.getOperand(I));
10281026
BuildMI(SMBB, DL, TII->get(AArch64::B)).addMBB(EndBB);

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9050,9 +9050,6 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
90509050
if (MF.getTarget().Options.EmitCallGraphSection && CB && CB->isIndirectCall())
90519051
CSInfo = MachineFunction::CallSiteInfo(*CB);
90529052

9053-
// Determine whether we need any streaming mode changes.
9054-
SMECallAttrs CallAttrs = getSMECallAttrs(MF.getFunction(), *this, CLI);
9055-
90569053
// Check callee args/returns for SVE registers and set calling convention
90579054
// accordingly.
90589055
if (CallConv == CallingConv::C || CallConv == CallingConv::Fast) {
@@ -9066,6 +9063,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
90669063
CallConv = CallingConv::AArch64_SVE_VectorCall;
90679064
}
90689065

9066+
// Determine whether we need any streaming mode changes.
9067+
SMECallAttrs CallAttrs = getSMECallAttrs(MF.getFunction(), *this, CLI);
90699068
bool UseNewSMEABILowering = Subtarget->useNewSMEABILowering();
90709069
bool IsAgnosticZAFunction = CallAttrs.caller().hasAgnosticZAInterface();
90719070
auto ZAMarkerNode = [&]() -> std::optional<unsigned> {
@@ -9084,7 +9083,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
90849083

90859084
// A sibling call is one where we're under the usual C ABI and not planning
90869085
// to change that but can still do a tail call:
9087-
if (!ZAMarkerNode.has_value() && !TailCallOpt && IsTailCall &&
9086+
if (!ZAMarkerNode && !TailCallOpt && IsTailCall &&
90889087
CallConv != CallingConv::Tail && CallConv != CallingConv::SwiftTail)
90899088
IsSibCall = true;
90909089

@@ -9233,8 +9232,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
92339232
Chain = DAG.getCALLSEQ_START(Chain, IsTailCall ? 0 : NumBytes, 0, DL);
92349233
if (ZAMarkerNode) {
92359234
// Note: We need the CALLSEQ_START to glue the ZAMarkerNode to, simply
9236-
// using a chain can result in incorrect scheduling. The markers referer
9237-
// to the position just before the CALLSEQ_START (though occur after as
9235+
// using a chain can result in incorrect scheduling. The markers refer to
9236+
// the position just before the CALLSEQ_START (though occur after as
92389237
// CALLSEQ_START lacks in-glue).
92399238
Chain = DAG.getNode(*ZAMarkerNode, DL, DAG.getVTList(MVT::Other),
92409239
{Chain, Chain.getValue(1)});

llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ let hasSideEffects = 1 in {
101101

102102
def CommitZAPseudo
103103
: Pseudo<(outs),
104-
(ins GPR64:$tpidr2_el0, i64imm:$restore_routine, variable_ops), []>,
104+
(ins GPR64:$tpidr2_el0, i64imm:$commit_routine, variable_ops), []>,
105105
Sched<[]>;
106106

107107
def AArch64_inout_za_use

llvm/lib/Target/AArch64/AArch64TargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ bool AArch64PassConfig::addILPOpts() {
824824
}
825825

826826
void AArch64PassConfig::addPreRegAlloc() {
827-
if (EnableNewSMEABILowering && TM->getOptLevel() == CodeGenOptLevel::None)
827+
if (TM->getOptLevel() == CodeGenOptLevel::None && EnableNewSMEABILowering)
828828
addPass(createMachineSMEABIPass());
829829

830830
// Change dead register definitions to refer to the zero register.

0 commit comments

Comments
 (0)