Skip to content

Commit c4c12b9

Browse files
committed
Rebase: Fix conflicts and use RTLIB
Change-Id: I8ff0f436bb17c59ee54d24dfb71606afabab8b81
1 parent 3f925a8 commit c4c12b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/AArch64/MachineSMEABIPass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ void MachineSMEABI::restorePhyRegSave(PhysRegSave const &RegSave,
432432
void 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

548549
void 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

Comments
 (0)