[llvm] r221321 - ARM: try to add extra CS-register whenever stack alignment >= 8.
Tim Northover
tnorthover at apple.com
Tue Nov 4 16:27:21 PST 2014
Author: tnorthover
Date: Tue Nov 4 18:27:20 2014
New Revision: 221321
URL: http://llvm.org/viewvc/llvm-project?rev=221321&view=rev
Log:
ARM: try to add extra CS-register whenever stack alignment >= 8.
We currently try to push an even number of registers to preserve 8-byte
alignment during a function's prologue, but only when the stack alignment is
prcisely 8. Many of the reasons for doing it apply also when that alignment > 8
(the extra store is often free, and can save another stack adjustment, though
less frequently for 16-byte stack alignment).
Modified:
llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
llvm/trunk/test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll
Modified: llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp?rev=221321&r1=221320&r2=221321&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp Tue Nov 4 18:27:20 2014
@@ -1575,7 +1575,7 @@ ARMFrameLowering::processFunctionBeforeC
// of GPRs, spill one extra callee save GPR so we won't have to pad between
// the integer and double callee save areas.
unsigned TargetAlign = getStackAlignment();
- if (TargetAlign == 8 && (NumGPRSpills & 1)) {
+ if (TargetAlign >= 8 && (NumGPRSpills & 1)) {
if (CS1Spilled && !UnspilledCS1GPRs.empty()) {
for (unsigned i = 0, e = UnspilledCS1GPRs.size(); i != e; ++i) {
unsigned Reg = UnspilledCS1GPRs[i];
Modified: llvm/trunk/test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll?rev=221321&r1=221320&r2=221321&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll Tue Nov 4 18:27:20 2014
@@ -22,9 +22,9 @@ define void @varargs_func(i32 %arg1, ...
; Reserve space for the varargs save area. This currently reserves
; more than enough (16 bytes rather than the 12 bytes needed).
; CHECK: sub sp, sp, #16
-; CHECK: push {lr}
+; CHECK: push {r11, lr}
; Align the stack pointer to a multiple of 16.
-; CHECK: sub sp, sp, #12
+; CHECK: sub sp, sp, #8
; Calculate the address of the varargs save area and save varargs
; arguments into it.
; CHECK-NEXT: add r0, sp, #20
More information about the llvm-commits
mailing list