@@ -432,6 +432,7 @@ void MachineSMEABI::restorePhyRegSave(PhysRegSave const &RegSave,
432432void MachineSMEABI::emitRestoreLazySave (MachineBasicBlock &MBB,
433433 MachineBasicBlock::iterator MBBI,
434434 LiveRegs PhysLiveRegs) {
435+ auto *TLI = Subtarget->getTargetLowering ();
435436 DebugLoc DL = getDebugLoc (MBB, MBBI);
436437 Register TPIDR2EL0 = MRI->createVirtualRegister (&AArch64::GPR64RegClass);
437438 Register TPIDR2 = AArch64::X0;
@@ -455,7 +456,7 @@ void MachineSMEABI::emitRestoreLazySave(MachineBasicBlock &MBB,
455456 BuildMI (MBB, MBBI, DL, TII->get (AArch64::RestoreZAPseudo))
456457 .addReg (TPIDR2EL0)
457458 .addReg (TPIDR2)
458- .addExternalSymbol (" __arm_tpidr2_restore " )
459+ .addExternalSymbol (TLI-> getLibcallName (RTLIB::SMEABI_TPIDR2_RESTORE) )
459460 .addRegMask (TRI->SMEABISupportRoutinesCallPreservedMaskFromX0 ());
460461 // Zero TPIDR2_EL0.
461462 BuildMI (MBB, MBBI, DL, TII->get (AArch64::MSR))
@@ -547,6 +548,7 @@ static void emitZeroZA(const TargetInstrInfo &TII, DebugLoc DL,
547548
548549void MachineSMEABI::emitNewZAPrologue (MachineBasicBlock &MBB,
549550 MachineBasicBlock::iterator MBBI) {
551+ auto *TLI = Subtarget->getTargetLowering ();
550552 DebugLoc DL = getDebugLoc (MBB, MBBI);
551553
552554 // Get current TPIDR2_EL0.
@@ -557,7 +559,7 @@ void MachineSMEABI::emitNewZAPrologue(MachineBasicBlock &MBB,
557559 // If TPIDR2_EL0 is non-zero, commit the lazy save.
558560 BuildMI (MBB, MBBI, DL, TII->get (AArch64::CommitZAPseudo))
559561 .addReg (TPIDR2EL0)
560- .addExternalSymbol (" __arm_tpidr2_save " )
562+ .addExternalSymbol (TLI-> getLibcallName (RTLIB::SMEABI_TPIDR2_SAVE) )
561563 .addRegMask (TRI->SMEABISupportRoutinesCallPreservedMaskFromX0 ());
562564 // Clear TPIDR2_EL0.
563565 BuildMI (MBB, MBBI, DL, TII->get (AArch64::MSR))
0 commit comments