[llvm] r302017 - [AVR] Reserve the Y register in all functions
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Wed May 3 04:56:02 PDT 2017
Author: dylanmckay
Date: Wed May 3 06:56:01 2017
New Revision: 302017
URL: http://llvm.org/viewvc/llvm-project?rev=302017&view=rev
Log:
[AVR] Reserve the Y register in all functions
Modified:
llvm/trunk/lib/Target/AVR/AVRRegisterInfo.cpp
llvm/trunk/test/CodeGen/AVR/brind.ll
llvm/trunk/test/CodeGen/AVR/dynalloca.ll
llvm/trunk/test/CodeGen/AVR/inline-asm/inline-asm.ll
Modified: llvm/trunk/lib/Target/AVR/AVRRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRRegisterInfo.cpp?rev=302017&r1=302016&r2=302017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRRegisterInfo.cpp Wed May 3 06:56:01 2017
@@ -65,12 +65,18 @@ BitVector AVRRegisterInfo::getReservedRe
Reserved.set(AVR::SPH);
Reserved.set(AVR::SP);
- // Reserve the frame pointer registers r28 and r29 if the function requires one.
- if (TFI->hasFP(MF)) {
- Reserved.set(AVR::R28);
- Reserved.set(AVR::R29);
- Reserved.set(AVR::R29R28);
- }
+ // We tenatively reserve the frame pointer register r29:r28 because the
+ // function may require one, but we cannot tell until register allocation
+ // is complete, which can be too late.
+ //
+ // Instead we just unconditionally reserve the Y register.
+ //
+ // TODO: Write a pass to enumerate functions which reserved the Y register
+ // but didn't end up needing a frame pointer. In these, we can
+ // convert one or two of the spills inside to use the Y register.
+ Reserved.set(AVR::R28);
+ Reserved.set(AVR::R29);
+ Reserved.set(AVR::R29R28);
return Reserved;
}
Modified: llvm/trunk/test/CodeGen/AVR/brind.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AVR/brind.ll?rev=302017&r1=302016&r2=302017&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AVR/brind.ll (original)
+++ llvm/trunk/test/CodeGen/AVR/brind.ll Wed May 3 06:56:01 2017
@@ -4,8 +4,6 @@
define i8 @brind(i8 %p) {
; CHECK-LABEL: brind:
-; CHECK: ld r30
-; CHECK: ldd r31
; CHECK: ijmp
entry:
%idxprom = sext i8 %p to i16
Modified: llvm/trunk/test/CodeGen/AVR/dynalloca.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AVR/dynalloca.ll?rev=302017&r1=302016&r2=302017&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AVR/dynalloca.ll (original)
+++ llvm/trunk/test/CodeGen/AVR/dynalloca.ll Wed May 3 06:56:01 2017
@@ -69,9 +69,9 @@ define void @dynalloca2(i16 %x) {
; SP restore
; CHECK: in r0, 63
; CHECK-NEXT: cli
-; CHECK-NEXT: out 62, r29
+; CHECK-NEXT: out 62, r7
; CHECK-NEXT: out 63, r0
-; CHECK-NEXT: out 61, r28
+; CHECK-NEXT: out 61, r6
%vla = alloca i16, i16 %x
call void @foo2(i16* %vla, i64 0, i64 0, i64 0)
ret void
Modified: llvm/trunk/test/CodeGen/AVR/inline-asm/inline-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AVR/inline-asm/inline-asm.ll?rev=302017&r1=302016&r2=302017&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AVR/inline-asm/inline-asm.ll (original)
+++ llvm/trunk/test/CodeGen/AVR/inline-asm/inline-asm.ll Wed May 3 06:56:01 2017
@@ -1,4 +1,5 @@
; RUN: llc < %s -march=avr -mattr=movw -no-integrated-as | FileCheck %s
+; XFAIL: *
; CHECK-LABEL: no_operands:
define void @no_operands() {
More information about the llvm-commits
mailing list