Enabling optimization should allow frame pointer elimination.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM. But I am wondering how it affects -g. Do we need to keep frame pointer when -g is specified? Should we add a test for -O3 -g?
Comment Actions
@scott.linder can answer about the -g question, but I would expect that the CFI is capable of describing the address of the CFA regardless of whether there is a frame pointer by simply knowing the constant offset from the stack pointer.
For AMDGPU it seems to me what we really have is an FP and we optimize away the SP since the stack grows low address to high address, and S32 points to the base of the frame, and not the top of the stack.
Comment Actions
Right, with CFI we will be able to describe every case we can generate code for, regardless of whether we optimize out the FP.