During reviewing https://reviews.llvm.org/D84419, @efriedma mentioned the gap between realigned stack pointer and origin stack pointer should be probed too whatever the alignment is. This patch fixes the issue for PPC64.
Details
- Reviewers
jsji efriedma serge-sans-paille nemanjai - Group Reviewers
Restricted Project - Commits
- rG97e7ce3b15cc: [PowerPC] Probe the gap between stackptr and realigned stackptr
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I cannot tell for the arch-specific part, but I see you've been reusing the different stack / alignemnt . probe test case from x86, so at least these configurations seems to be covered. +1 for me.
LGTM. Some comment update please.
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | ||
---|---|---|
1210 | getStackProbeSize returns unsigned. Maybe we should use unsigned for ProbeSize? | |
1282 | Document ScratchReg and TempReg please. And also document the assumption, eg: stackptr is in BPReg etc. | |
1286 | // ScratchReg = stackptr % align | |
1291 | // TempReg = stackptr - (stackptr % align) | |
1295 | // ScratchReg = (stackptr % align) % probesize |
getStackProbeSize returns unsigned.
So this should still be safe , as we won't have large uint64 ProbeSize that may become negative when casting to int64_t.
However, this looks like a potential trap to me.
Maybe we should use unsigned for ProbeSize?