[llvm] r373738 - ARM-Darwin: keep the frame register reserved even if not updated.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 05:29:32 PDT 2019
Author: tnorthover
Date: Fri Oct 4 05:29:32 2019
New Revision: 373738
URL: http://llvm.org/viewvc/llvm-project?rev=373738&view=rev
Log:
ARM-Darwin: keep the frame register reserved even if not updated.
Darwin platforms need the frame register to always point at a valid record even
if it's not updated in a leaf function. Backtraces are more important than one
extra GPR.
Added:
llvm/trunk/test/CodeGen/ARM/r7-fixed-darwin.ll
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/trunk/test/CodeGen/Thumb/long.ll
llvm/trunk/test/CodeGen/Thumb2/2010-03-15-AsmCCClobber.ll
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=373738&r1=373737&r2=373738&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Fri Oct 4 05:29:32 2019
@@ -191,7 +191,7 @@ getReservedRegs(const MachineFunction &M
markSuperRegs(Reserved, ARM::PC);
markSuperRegs(Reserved, ARM::FPSCR);
markSuperRegs(Reserved, ARM::APSR_NZCV);
- if (TFI->hasFP(MF))
+ if (TFI->hasFP(MF) || STI.isTargetDarwin())
markSuperRegs(Reserved, getFramePointerReg(STI));
if (hasBasePointer(MF))
markSuperRegs(Reserved, BasePtr);
Added: llvm/trunk/test/CodeGen/ARM/r7-fixed-darwin.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/r7-fixed-darwin.ll?rev=373738&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/r7-fixed-darwin.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/r7-fixed-darwin.ll Fri Oct 4 05:29:32 2019
@@ -0,0 +1,15 @@
+; RUN: llc -mtriple=thumbv7k-apple-watchos %s -o - | FileCheck %s
+
+; r7 is FP on Darwin, and should be preserved even if we don't create a new
+; frame record for this leaf function. So make huge register pressure to try &
+; tempt LLVM to use it.
+define void @foo([16 x i32]* %ptr) {
+; CHECK-LABEL: foo:
+; CHECK: push.w
+; CHECK: .cfi_offset r7
+; CHECK-NOT: r7
+; CHECK: pop.w
+ %val = load volatile [16 x i32], [16 x i32]* %ptr
+ store volatile [16 x i32] %val, [16 x i32]* %ptr
+ ret void
+}
Modified: llvm/trunk/test/CodeGen/Thumb/long.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/long.ll?rev=373738&r1=373737&r2=373738&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb/long.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb/long.ll Fri Oct 4 05:29:32 2019
@@ -234,7 +234,7 @@ if.end:
%c = add i64 %y, 47
call void @f13(i64 %c)
; CHECK: adds
-; CHECK-NEXT: adcs
+; CHECK: adcs
; CHECK: bl
ret void
}
Modified: llvm/trunk/test/CodeGen/Thumb2/2010-03-15-AsmCCClobber.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/2010-03-15-AsmCCClobber.ll?rev=373738&r1=373737&r2=373738&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/2010-03-15-AsmCCClobber.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/2010-03-15-AsmCCClobber.ll Fri Oct 4 05:29:32 2019
@@ -17,7 +17,7 @@ target datalayout = "e-p:32:32:32-i1:8:3
; CHECK: bl _f2
; CHECK: clz {{r[0-9]+}}
; CHECK-DAG: lsrs {{r[0-9]+}}
-; CHECK-DAG: lsls {{r[0-9]+}}
+; CHECK-DAG: lsl.w {{r[0-9]+}}
; CHECK-NEXT: orr.w {{r[0-9]+}}
; CHECK-NEXT: InlineAsm Start
define void @test(%s1* %this, i32 %format, i32 %w, i32 %h, i32 %levels, i32* %s, i8* %data, i32* nocapture %rowbytes, void (i8*, i8*)* %release, i8* %info) nounwind {
More information about the llvm-commits
mailing list