diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-08-10 19:30:19 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-08-10 19:30:19 +0000 |
commit | ac096808a3accc516ae7c193c9a2c1392bf3301a (patch) | |
tree | 7add14add83e0e065548a9ad801a591251ca6a83 /lib/Target/ARM/ARMRegisterInfo.td | |
parent | 98197e55c10176c3ef9100f7d852abbd2347225f (diff) | |
download | external_llvm-ac096808a3accc516ae7c193c9a2c1392bf3301a.zip external_llvm-ac096808a3accc516ae7c193c9a2c1392bf3301a.tar.gz external_llvm-ac096808a3accc516ae7c193c9a2c1392bf3301a.tar.bz2 |
Re-apply r110655 with fixes. Epilogue must restore sp from fp if the function stack frame has a var-sized object.
Also added a test case to check for the added benefit of this patch: it's optimizing away the unnecessary restore of sp from fp for some non-leaf functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMRegisterInfo.td')
-rw-r--r-- | lib/Target/ARM/ARMRegisterInfo.td | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/Target/ARM/ARMRegisterInfo.td b/lib/Target/ARM/ARMRegisterInfo.td index 5e17175..2b72739 100644 --- a/lib/Target/ARM/ARMRegisterInfo.td +++ b/lib/Target/ARM/ARMRegisterInfo.td @@ -294,8 +294,7 @@ def GPR : RegisterClass<"ARM", [i32], 32, [R0, R1, R2, R3, R4, R5, R6, if (Subtarget.isThumb1Only()) { I = THUMB_GPR_AO + (sizeof(THUMB_GPR_AO)/sizeof(unsigned)); - // Mac OS X requires FP not to be clobbered for backtracing purpose. - return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I; + return RI->hasFP(MF) ? I-1 : I; } if (Subtarget.isTargetDarwin()) { @@ -312,8 +311,7 @@ def GPR : RegisterClass<"ARM", [i32], 32, [R0, R1, R2, R3, R4, R5, R6, I = ARM_GPR_AO_1 + (sizeof(ARM_GPR_AO_1)/sizeof(unsigned)); } - // Mac OS X requires FP not to be clobbered for backtracing purpose. - return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I; + return RI->hasFP(MF) ? I-1 : I; } }]; } @@ -403,8 +401,7 @@ def rGPR : RegisterClass<"ARM", [i32], 32, [R0, R1, R2, R3, R4, R5, R6, if (Subtarget.isThumb1Only()) { I = THUMB_rGPRAO + (sizeof(THUMB_rGPRAO)/sizeof(unsigned)); - // Mac OS X requires FP not to be clobbered for backtracing purpose. - return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I; + return RI->hasFP(MF) ? I-1 : I; } if (Subtarget.isTargetDarwin()) { @@ -421,8 +418,7 @@ def rGPR : RegisterClass<"ARM", [i32], 32, [R0, R1, R2, R3, R4, R5, R6, I = ARM_rGPRAO_1 + (sizeof(ARM_rGPRAO_1)/sizeof(unsigned)); } - // Mac OS X requires FP not to be clobbered for backtracing purpose. - return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I; + return RI->hasFP(MF) ? I-1 : I; } }]; } @@ -449,11 +445,9 @@ def tGPR : RegisterClass<"ARM", [i32], 32, [R0, R1, R2, R3, R4, R5, R6, R7]> { tGPRClass::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); const TargetRegisterInfo *RI = TM.getRegisterInfo(); - const ARMSubtarget &Subtarget = TM.getSubtarget<ARMSubtarget>(); tGPRClass::iterator I = THUMB_tGPR_AO + (sizeof(THUMB_tGPR_AO)/sizeof(unsigned)); - // Mac OS X requires FP not to be clobbered for backtracing purpose. - return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I; + return RI->hasFP(MF) ? I-1 : I; } }]; } |