Skip to content

Commit 2c9dc08

Browse files
authored
[AArch64] Use spill size when calculating callee saves size (NFC) (#123086)
This is an NFC right now, as currently, all register and spill sizes are the same, but the spill size is the correct size to use here.
1 parent 3b3590a commit 2c9dc08

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/AArch64/AArch64FrameLowering.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3795,14 +3795,15 @@ void AArch64FrameLowering::determineCalleeSaves(MachineFunction &MF,
37953795
unsigned CSStackSize = 0;
37963796
unsigned SVECSStackSize = 0;
37973797
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
3798-
const MachineRegisterInfo &MRI = MF.getRegInfo();
37993798
for (unsigned Reg : SavedRegs.set_bits()) {
3800-
auto RegSize = TRI->getRegSizeInBits(Reg, MRI) / 8;
3799+
auto *RC = TRI->getMinimalPhysRegClass(Reg);
3800+
assert(RC && "expected register class!");
3801+
auto SpillSize = TRI->getSpillSize(*RC);
38013802
if (AArch64::PPRRegClass.contains(Reg) ||
38023803
AArch64::ZPRRegClass.contains(Reg))
3803-
SVECSStackSize += RegSize;
3804+
SVECSStackSize += SpillSize;
38043805
else
3805-
CSStackSize += RegSize;
3806+
CSStackSize += SpillSize;
38063807
}
38073808

38083809
// Increase the callee-saved stack size if the function has streaming mode

0 commit comments

Comments
 (0)