[PATCH] ARM: fold stack update into push/pop

Tim Northover t.p.northover at gmail.com
Wed Nov 6 10:02:01 PST 2013


Hi Renato,

>   If I got it right, you're detecting the first push and the last pop and is just adding clobbered registers to them to save the stack pointer arithmetic. I can't think of a situation where the first push/last pop won't be prologue/epilogue, so I'll skip the relevant comment.

It's actually the last push of the prologue and first pop of the
epilogue (there could be quite a few eligible ones depending on
platform & registers saved). I think the way we're iterating through
in emitPrologue/emitEpilogue guarantees that any push we decide to use
will be suitable.

The case where there's none is handled by the hasStackFrame() test
near the beginning in each case.

Thanks for your suggestions, they all looked like very good ideas so
I'll be uploading an updated patch soon. I agree it's a good idea to
wait for someone else though so I won't commit.

Cheers.

Tim.




More information about the llvm-commits mailing list