Skip to content

Commit 81c06d1

Browse files
authored
Reland "[AArch64][SME] Port all SME routines to RuntimeLibcalls" (#153417)
This updates everywhere we emit/check an SME routines to use RuntimeLibcalls to get the function name and calling convention.
1 parent 2a02147 commit 81c06d1

File tree

10 files changed

+182
-89
lines changed

10 files changed

+182
-89
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,6 +3574,12 @@ class LLVM_ABI TargetLoweringBase {
35743574
return Libcalls.getMemcpyName().data();
35753575
}
35763576

3577+
/// Check if this is valid libcall for the current module, otherwise
3578+
/// RTLIB::Unsupported.
3579+
RTLIB::LibcallImpl getSupportedLibcallImpl(StringRef FuncName) const {
3580+
return Libcalls.getSupportedLibcallImpl(FuncName);
3581+
}
3582+
35773583
/// Get the comparison predicate that's to be used to test the result of the
35783584
/// comparison libcall against zero. This should only be used with
35793585
/// floating-point compare libcalls.

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,17 @@ multiclass LibmLongDoubleLibCall<string libcall_basename = !toupper(NAME),
406406
def SC_MEMCPY : RuntimeLibcall;
407407
def SC_MEMMOVE : RuntimeLibcall;
408408
def SC_MEMSET : RuntimeLibcall;
409+
def SC_MEMCHR: RuntimeLibcall;
410+
411+
// AArch64 SME ABI calls
412+
def SMEABI_SME_STATE : RuntimeLibcall;
413+
def SMEABI_TPIDR2_SAVE : RuntimeLibcall;
414+
def SMEABI_ZA_DISABLE : RuntimeLibcall;
415+
def SMEABI_TPIDR2_RESTORE : RuntimeLibcall;
416+
def SMEABI_GET_CURRENT_VG : RuntimeLibcall;
417+
def SMEABI_SME_STATE_SIZE : RuntimeLibcall;
418+
def SMEABI_SME_SAVE : RuntimeLibcall;
419+
def SMEABI_SME_RESTORE : RuntimeLibcall;
409420

410421
// ARM EABI calls
411422
def AEABI_MEMCPY4 : RuntimeLibcall; // Align 4
@@ -1223,8 +1234,35 @@ defset list<RuntimeLibcallImpl> AArch64LibcallImpls = {
12231234
def __arm_sc_memcpy : RuntimeLibcallImpl<SC_MEMCPY>;
12241235
def __arm_sc_memmove : RuntimeLibcallImpl<SC_MEMMOVE>;
12251236
def __arm_sc_memset : RuntimeLibcallImpl<SC_MEMSET>;
1237+
def __arm_sc_memchr : RuntimeLibcallImpl<SC_MEMCHR>;
12261238
} // End AArch64LibcallImpls
12271239

1240+
def __arm_sme_state : RuntimeLibcallImpl<SMEABI_SME_STATE>;
1241+
def __arm_tpidr2_save : RuntimeLibcallImpl<SMEABI_TPIDR2_SAVE>;
1242+
def __arm_za_disable : RuntimeLibcallImpl<SMEABI_ZA_DISABLE>;
1243+
def __arm_tpidr2_restore : RuntimeLibcallImpl<SMEABI_TPIDR2_RESTORE>;
1244+
def __arm_get_current_vg : RuntimeLibcallImpl<SMEABI_GET_CURRENT_VG>;
1245+
def __arm_sme_state_size : RuntimeLibcallImpl<SMEABI_SME_STATE_SIZE>;
1246+
def __arm_sme_save : RuntimeLibcallImpl<SMEABI_SME_SAVE>;
1247+
def __arm_sme_restore : RuntimeLibcallImpl<SMEABI_SME_RESTORE>;
1248+
1249+
def SMEABI_LibCalls_PreserveMost_From_X0 : LibcallsWithCC<(add
1250+
__arm_tpidr2_save,
1251+
__arm_za_disable,
1252+
__arm_tpidr2_restore),
1253+
SMEABI_PreserveMost_From_X0>;
1254+
1255+
def SMEABI_LibCalls_PreserveMost_From_X1 : LibcallsWithCC<(add
1256+
__arm_get_current_vg,
1257+
__arm_sme_state_size,
1258+
__arm_sme_save,
1259+
__arm_sme_restore),
1260+
SMEABI_PreserveMost_From_X1>;
1261+
1262+
def SMEABI_LibCalls_PreserveMost_From_X2 : LibcallsWithCC<(add
1263+
__arm_sme_state),
1264+
SMEABI_PreserveMost_From_X2>;
1265+
12281266
def isAArch64_ExceptArm64EC
12291267
: RuntimeLibcallPredicate<"(TT.isAArch64() && !TT.isWindowsArm64EC())">;
12301268
def isWindowsArm64EC : RuntimeLibcallPredicate<"TT.isWindowsArm64EC()">;
@@ -1244,7 +1282,10 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
12441282
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
12451283
DefaultLibmExp10,
12461284
DefaultStackProtector,
1247-
SecurityCheckCookieIfWinMSVC)
1285+
SecurityCheckCookieIfWinMSVC,
1286+
SMEABI_LibCalls_PreserveMost_From_X0,
1287+
SMEABI_LibCalls_PreserveMost_From_X1,
1288+
SMEABI_LibCalls_PreserveMost_From_X2)
12481289
>;
12491290

12501291
// Prepend a # to every name

llvm/include/llvm/IR/RuntimeLibcallsImpl.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def ARM_AAPCS : LibcallCallingConv<[{CallingConv::ARM_AAPCS}]>;
3636
def ARM_AAPCS_VFP : LibcallCallingConv<[{CallingConv::ARM_AAPCS_VFP}]>;
3737
def X86_STDCALL : LibcallCallingConv<[{CallingConv::X86_StdCall}]>;
3838
def AVR_BUILTIN : LibcallCallingConv<[{CallingConv::AVR_BUILTIN}]>;
39+
def SMEABI_PreserveMost_From_X0 : LibcallCallingConv<[{CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X0}]>;
40+
def SMEABI_PreserveMost_From_X1 : LibcallCallingConv<[{CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1}]>;
41+
def SMEABI_PreserveMost_From_X2 : LibcallCallingConv<[{CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2}]>;
3942

4043
/// Abstract definition for functionality the compiler may need to
4144
/// emit a call to. Emits the RTLIB::Libcall enum - This enum defines

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,24 +1475,26 @@ static bool requiresSaveVG(const MachineFunction &MF) {
14751475
return true;
14761476
}
14771477

1478-
bool isVGInstruction(MachineBasicBlock::iterator MBBI) {
1478+
static bool matchLibcall(const TargetLowering &TLI, const MachineOperand &MO,
1479+
RTLIB::Libcall LC) {
1480+
return MO.isSymbol() &&
1481+
StringRef(TLI.getLibcallName(LC)) == MO.getSymbolName();
1482+
}
1483+
1484+
bool isVGInstruction(MachineBasicBlock::iterator MBBI,
1485+
const TargetLowering &TLI) {
14791486
unsigned Opc = MBBI->getOpcode();
14801487
if (Opc == AArch64::CNTD_XPiI || Opc == AArch64::RDSVLI_XI ||
14811488
Opc == AArch64::UBFMXri)
14821489
return true;
14831490

1484-
if (requiresGetVGCall(*MBBI->getMF())) {
1485-
if (Opc == AArch64::ORRXrr)
1486-
return true;
1491+
if (!requiresGetVGCall(*MBBI->getMF()))
1492+
return false;
14871493

1488-
if (Opc == AArch64::BL) {
1489-
auto Op1 = MBBI->getOperand(0);
1490-
return Op1.isSymbol() &&
1491-
(StringRef(Op1.getSymbolName()) == "__arm_get_current_vg");
1492-
}
1493-
}
1494+
if (Opc == AArch64::BL)
1495+
return matchLibcall(TLI, MBBI->getOperand(0), RTLIB::SMEABI_GET_CURRENT_VG);
14941496

1495-
return false;
1497+
return Opc == AArch64::ORRXrr;
14961498
}
14971499

14981500
// Convert callee-save register save/restore instruction to do stack pointer
@@ -1511,9 +1513,11 @@ static MachineBasicBlock::iterator convertCalleeSaveRestoreToSPPrePostIncDec(
15111513
// functions, we need to do this for both the streaming and non-streaming
15121514
// vector length. Move past these instructions if necessary.
15131515
MachineFunction &MF = *MBB.getParent();
1514-
if (requiresSaveVG(MF))
1515-
while (isVGInstruction(MBBI))
1516+
if (requiresSaveVG(MF)) {
1517+
auto &TLI = *MF.getSubtarget().getTargetLowering();
1518+
while (isVGInstruction(MBBI, TLI))
15161519
++MBBI;
1520+
}
15171521

15181522
switch (MBBI->getOpcode()) {
15191523
default:
@@ -2097,11 +2101,12 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF,
20972101
// Move past the saves of the callee-saved registers, fixing up the offsets
20982102
// and pre-inc if we decided to combine the callee-save and local stack
20992103
// pointer bump above.
2104+
auto &TLI = *MF.getSubtarget().getTargetLowering();
21002105
while (MBBI != End && MBBI->getFlag(MachineInstr::FrameSetup) &&
21012106
!IsSVECalleeSave(MBBI)) {
21022107
if (CombineSPBump &&
21032108
// Only fix-up frame-setup load/store instructions.
2104-
(!requiresSaveVG(MF) || !isVGInstruction(MBBI)))
2109+
(!requiresSaveVG(MF) || !isVGInstruction(MBBI, TLI)))
21052110
fixupCalleeSaveRestoreStackOffset(*MBBI, AFI->getLocalStackSize(),
21062111
NeedsWinCFI, &HasWinCFI);
21072112
++MBBI;
@@ -3468,6 +3473,7 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters(
34683473
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
34693474
ArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const {
34703475
MachineFunction &MF = *MBB.getParent();
3476+
auto &TLI = *MF.getSubtarget<AArch64Subtarget>().getTargetLowering();
34713477
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
34723478
AArch64FunctionInfo *AFI = MF.getInfo<AArch64FunctionInfo>();
34733479
bool NeedsWinCFI = needsWinCFI(MF);
@@ -3581,11 +3587,11 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters(
35813587
.addReg(AArch64::X0, RegState::Implicit)
35823588
.setMIFlag(MachineInstr::FrameSetup);
35833589

3584-
const uint32_t *RegMask = TRI->getCallPreservedMask(
3585-
MF,
3586-
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1);
3590+
RTLIB::Libcall LC = RTLIB::SMEABI_GET_CURRENT_VG;
3591+
const uint32_t *RegMask =
3592+
TRI->getCallPreservedMask(MF, TLI.getLibcallCallingConv(LC));
35873593
BuildMI(MBB, MI, DL, TII.get(AArch64::BL))
3588-
.addExternalSymbol("__arm_get_current_vg")
3594+
.addExternalSymbol(TLI.getLibcallName(LC))
35893595
.addRegMask(RegMask)
35903596
.addReg(AArch64::X0, RegState::ImplicitDefine)
35913597
.setMIFlag(MachineInstr::FrameSetup);

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,13 +3083,12 @@ AArch64TargetLowering::EmitGetSMESaveSize(MachineInstr &MI,
30833083
AArch64FunctionInfo *FuncInfo = MF->getInfo<AArch64FunctionInfo>();
30843084
const TargetInstrInfo *TII = Subtarget->getInstrInfo();
30853085
if (FuncInfo->isSMESaveBufferUsed()) {
3086+
RTLIB::Libcall LC = RTLIB::SMEABI_SME_STATE_SIZE;
30863087
const AArch64RegisterInfo *TRI = Subtarget->getRegisterInfo();
30873088
BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(AArch64::BL))
3088-
.addExternalSymbol("__arm_sme_state_size")
3089+
.addExternalSymbol(getLibcallName(LC))
30893090
.addReg(AArch64::X0, RegState::ImplicitDefine)
3090-
.addRegMask(TRI->getCallPreservedMask(
3091-
*MF, CallingConv::
3092-
AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1));
3091+
.addRegMask(TRI->getCallPreservedMask(*MF, getLibcallCallingConv(LC)));
30933092
BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(TargetOpcode::COPY),
30943093
MI.getOperand(0).getReg())
30953094
.addReg(AArch64::X0);
@@ -3109,13 +3108,12 @@ AArch64TargetLowering::EmitEntryPStateSM(MachineInstr &MI,
31093108
const TargetInstrInfo *TII = Subtarget->getInstrInfo();
31103109
Register ResultReg = MI.getOperand(0).getReg();
31113110
if (FuncInfo->isPStateSMRegUsed()) {
3111+
RTLIB::Libcall LC = RTLIB::SMEABI_SME_STATE;
31123112
const AArch64RegisterInfo *TRI = Subtarget->getRegisterInfo();
31133113
BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(AArch64::BL))
3114-
.addExternalSymbol("__arm_sme_state")
3114+
.addExternalSymbol(getLibcallName(LC))
31153115
.addReg(AArch64::X0, RegState::ImplicitDefine)
3116-
.addRegMask(TRI->getCallPreservedMask(
3117-
*MF, CallingConv::
3118-
AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2));
3116+
.addRegMask(TRI->getCallPreservedMask(*MF, getLibcallCallingConv(LC)));
31193117
BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(TargetOpcode::COPY), ResultReg)
31203118
.addReg(AArch64::X0);
31213119
} else {
@@ -5733,15 +5731,15 @@ static SDValue getSVEPredicateBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) {
57335731
SDValue AArch64TargetLowering::getRuntimePStateSM(SelectionDAG &DAG,
57345732
SDValue Chain, SDLoc DL,
57355733
EVT VT) const {
5736-
SDValue Callee = DAG.getExternalSymbol("__arm_sme_state",
5734+
RTLIB::Libcall LC = RTLIB::SMEABI_SME_STATE;
5735+
SDValue Callee = DAG.getExternalSymbol(getLibcallName(LC),
57375736
getPointerTy(DAG.getDataLayout()));
57385737
Type *Int64Ty = Type::getInt64Ty(*DAG.getContext());
57395738
Type *RetTy = StructType::get(Int64Ty, Int64Ty);
57405739
TargetLowering::CallLoweringInfo CLI(DAG);
57415740
ArgListTy Args;
57425741
CLI.setDebugLoc(DL).setChain(Chain).setLibCallee(
5743-
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2,
5744-
RetTy, Callee, std::move(Args));
5742+
getLibcallCallingConv(LC), RetTy, Callee, std::move(Args));
57455743
std::pair<SDValue, SDValue> CallResult = LowerCallTo(CLI);
57465744
SDValue Mask = DAG.getConstant(/*PSTATE.SM*/ 1, DL, MVT::i64);
57475745
return DAG.getNode(ISD::AND, DL, MVT::i64, CallResult.first.getOperand(0),
@@ -8594,12 +8592,12 @@ static void analyzeCallOperands(const AArch64TargetLowering &TLI,
85948592
}
85958593

85968594
static SMECallAttrs
8597-
getSMECallAttrs(const Function &Caller,
8595+
getSMECallAttrs(const Function &Caller, const AArch64TargetLowering &TLI,
85988596
const TargetLowering::CallLoweringInfo &CLI) {
85998597
if (CLI.CB)
8600-
return SMECallAttrs(*CLI.CB);
8598+
return SMECallAttrs(*CLI.CB, &TLI);
86018599
if (auto *ES = dyn_cast<ExternalSymbolSDNode>(CLI.Callee))
8602-
return SMECallAttrs(SMEAttrs(Caller), SMEAttrs(ES->getSymbol()));
8600+
return SMECallAttrs(SMEAttrs(Caller), SMEAttrs(ES->getSymbol(), TLI));
86038601
return SMECallAttrs(SMEAttrs(Caller), SMEAttrs(SMEAttrs::Normal));
86048602
}
86058603

@@ -8621,7 +8619,7 @@ bool AArch64TargetLowering::isEligibleForTailCallOptimization(
86218619

86228620
// SME Streaming functions are not eligible for TCO as they may require
86238621
// the streaming mode or ZA to be restored after returning from the call.
8624-
SMECallAttrs CallAttrs = getSMECallAttrs(CallerF, CLI);
8622+
SMECallAttrs CallAttrs = getSMECallAttrs(CallerF, *this, CLI);
86258623
if (CallAttrs.requiresSMChange() || CallAttrs.requiresLazySave() ||
86268624
CallAttrs.requiresPreservingAllZAState() ||
86278625
CallAttrs.caller().hasStreamingBody())
@@ -8913,14 +8911,14 @@ static SDValue emitSMEStateSaveRestore(const AArch64TargetLowering &TLI,
89138911
DAG.getCopyFromReg(Chain, DL, Info->getSMESaveBufferAddr(), MVT::i64),
89148912
PointerType::getUnqual(*DAG.getContext()));
89158913

8916-
SDValue Callee =
8917-
DAG.getExternalSymbol(IsSave ? "__arm_sme_save" : "__arm_sme_restore",
8918-
TLI.getPointerTy(DAG.getDataLayout()));
8914+
RTLIB::Libcall LC =
8915+
IsSave ? RTLIB::SMEABI_SME_SAVE : RTLIB::SMEABI_SME_RESTORE;
8916+
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
8917+
TLI.getPointerTy(DAG.getDataLayout()));
89198918
auto *RetTy = Type::getVoidTy(*DAG.getContext());
89208919
TargetLowering::CallLoweringInfo CLI(DAG);
89218920
CLI.setDebugLoc(DL).setChain(Chain).setLibCallee(
8922-
CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1, RetTy,
8923-
Callee, std::move(Args));
8921+
TLI.getLibcallCallingConv(LC), RetTy, Callee, std::move(Args));
89248922
return TLI.LowerCallTo(CLI).second;
89258923
}
89268924

@@ -9108,7 +9106,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
91089106
}
91099107

91109108
// Determine whether we need any streaming mode changes.
9111-
SMECallAttrs CallAttrs = getSMECallAttrs(MF.getFunction(), CLI);
9109+
SMECallAttrs CallAttrs = getSMECallAttrs(MF.getFunction(), *this, CLI);
91129110

91139111
auto DescribeCallsite =
91149112
[&](OptimizationRemarkAnalysis &R) -> OptimizationRemarkAnalysis & {
@@ -9685,11 +9683,12 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
96859683

96869684
if (RequiresLazySave) {
96879685
// Conditionally restore the lazy save using a pseudo node.
9686+
RTLIB::Libcall LC = RTLIB::SMEABI_TPIDR2_RESTORE;
96889687
TPIDR2Object &TPIDR2 = FuncInfo->getTPIDR2Obj();
96899688
SDValue RegMask = DAG.getRegisterMask(
9690-
TRI->SMEABISupportRoutinesCallPreservedMaskFromX0());
9689+
TRI->getCallPreservedMask(MF, getLibcallCallingConv(LC)));
96919690
SDValue RestoreRoutine = DAG.getTargetExternalSymbol(
9692-
"__arm_tpidr2_restore", getPointerTy(DAG.getDataLayout()));
9691+
getLibcallName(LC), getPointerTy(DAG.getDataLayout()));
96939692
SDValue TPIDR2_EL0 = DAG.getNode(
96949693
ISD::INTRINSIC_W_CHAIN, DL, MVT::i64, Result,
96959694
DAG.getConstant(Intrinsic::aarch64_sme_get_tpidr2, DL, MVT::i32));
@@ -29028,7 +29027,7 @@ bool AArch64TargetLowering::fallBackToDAGISel(const Instruction &Inst) const {
2902829027

2902929028
// Checks to allow the use of SME instructions
2903029029
if (auto *Base = dyn_cast<CallBase>(&Inst)) {
29031-
auto CallAttrs = SMECallAttrs(*Base);
29030+
auto CallAttrs = SMECallAttrs(*Base, this);
2903229031
if (CallAttrs.requiresSMChange() || CallAttrs.requiresLazySave() ||
2903329032
CallAttrs.requiresPreservingZT0() ||
2903429033
CallAttrs.requiresPreservingAllZAState())

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,17 @@ static cl::opt<bool> EnableFixedwidthAutovecInStreamingMode(
220220
static cl::opt<bool> EnableScalableAutovecInStreamingMode(
221221
"enable-scalable-autovec-in-streaming-mode", cl::init(false), cl::Hidden);
222222

223-
static bool isSMEABIRoutineCall(const CallInst &CI) {
223+
static bool isSMEABIRoutineCall(const CallInst &CI,
224+
const AArch64TargetLowering &TLI) {
224225
const auto *F = CI.getCalledFunction();
225-
return F && StringSwitch<bool>(F->getName())
226-
.Case("__arm_sme_state", true)
227-
.Case("__arm_tpidr2_save", true)
228-
.Case("__arm_tpidr2_restore", true)
229-
.Case("__arm_za_disable", true)
230-
.Default(false);
226+
return F && SMEAttrs(F->getName(), TLI).isSMEABIRoutine();
231227
}
232228

233229
/// Returns true if the function has explicit operations that can only be
234230
/// lowered using incompatible instructions for the selected mode. This also
235231
/// returns true if the function F may use or modify ZA state.
236-
static bool hasPossibleIncompatibleOps(const Function *F) {
232+
static bool hasPossibleIncompatibleOps(const Function *F,
233+
const AArch64TargetLowering &TLI) {
237234
for (const BasicBlock &BB : *F) {
238235
for (const Instruction &I : BB) {
239236
// Be conservative for now and assume that any call to inline asm or to
@@ -242,7 +239,7 @@ static bool hasPossibleIncompatibleOps(const Function *F) {
242239
// all native LLVM instructions can be lowered to compatible instructions.
243240
if (isa<CallInst>(I) && !I.isDebugOrPseudoInst() &&
244241
(cast<CallInst>(I).isInlineAsm() || isa<IntrinsicInst>(I) ||
245-
isSMEABIRoutineCall(cast<CallInst>(I))))
242+
isSMEABIRoutineCall(cast<CallInst>(I), TLI)))
246243
return true;
247244
}
248245
}
@@ -290,7 +287,7 @@ bool AArch64TTIImpl::areInlineCompatible(const Function *Caller,
290287
if (CallAttrs.requiresLazySave() || CallAttrs.requiresSMChange() ||
291288
CallAttrs.requiresPreservingZT0() ||
292289
CallAttrs.requiresPreservingAllZAState()) {
293-
if (hasPossibleIncompatibleOps(Callee))
290+
if (hasPossibleIncompatibleOps(Callee, *getTLI()))
294291
return false;
295292
}
296293

@@ -357,7 +354,7 @@ AArch64TTIImpl::getInlineCallPenalty(const Function *F, const CallBase &Call,
357354
// change only once and avoid inlining of G into F.
358355

359356
SMEAttrs FAttrs(*F);
360-
SMECallAttrs CallAttrs(Call);
357+
SMECallAttrs CallAttrs(Call, getTLI());
361358

362359
if (SMECallAttrs(FAttrs, CallAttrs.callee()).requiresSMChange()) {
363360
if (F == Call.getCaller()) // (1)

0 commit comments

Comments
 (0)