[PATCH] ARM: fold stack update into push/pop
Tim Northover
t.p.northover at gmail.com
Tue Nov 5 16:28:15 PST 2013
Hi all,
The attached patch is designed to help embedded work, and particularly situations where code-size is paramount. It converts prologue sequences like:
push {r7, lr}
sub sp, sp, #16
into:
push {r3, r4, r5, r6, r7, lr}
(where we don't actually care about r3-r6, but they take up space on the stack).
Analogous epilogue sequences are also converted where possible, saving up to 4 bytes per function.
As far as I can tell from some simple tests this almost always slows code down though, so it's gated on the MinSize function attribute.
Could someone take a look, please? Frame lowering code is always rather hairy.
http://llvm-reviews.chandlerc.com/D2105
Files:
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h
lib/Target/ARM/ARMFrameLowering.cpp
lib/Target/ARM/Thumb1FrameLowering.cpp
test/CodeGen/ARM/fold-stack-adjust.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2105.1.patch
Type: text/x-patch
Size: 16114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131105/c49c7397/attachment.bin>
More information about the llvm-commits
mailing list