[llvm] [AArch64] Fix miscompilation due to integer overflow in immediate offset for stack store/load instructions with preserve_all (PR #207026)
Ömer Sinan Ağacan via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 01:38:52 PDT 2026
================
@@ -2647,11 +2649,23 @@ void AArch64FrameLowering::determineCalleeSaves(MachineFunction &MF,
auto SpillSize = TRI->getSpillSize(*RC);
bool IsZPR = AArch64::ZPRRegClass.contains(Reg);
bool IsPPR = !IsZPR && AArch64::PPRRegClass.contains(Reg);
+
+ // A register and its super-register can both appear in SavedRegs (e.g. for
+ // preserve_all, AAPCS contributes D8-D15 while the extended convention
+ // contributes the enclosing Q8-Q31). Only the widest register is actually
+ // spilled, skip such sub-registers here to avoid double-counting the
+ // overlap.
----------------
osa1 wrote:
This seems to be a separate issue than #204564. Could this be moved to a separate PR, with tests?
https://github.com/llvm/llvm-project/pull/207026
More information about the llvm-commits
mailing list