llvm-6502/test/CodeGen/PowerPC/2010-05-03-retaddr1.ll
Hal Finkel 4d53e7798c Don't reserve R2 on Darwin/PPC
Now that only the register-scavenger version of the CR spilling code remains,
we no longer need the Darwin R2 hack. Darwin can use R0 as a spare register in
any case where the System V ABI uses it (R0 is special architecturally, and so
is reserved under all common ABIs).

A few test cases needed to be updated to reflect the register-allocation changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176868 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 15:18:14 +00:00

26 lines
688 B
LLVM

; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 | FileCheck %s
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin -mcpu=g5 -regalloc=basic | FileCheck %s
declare i8* @llvm.frameaddress(i32) nounwind readnone
define i8* @g2() nounwind readnone {
entry:
; CHECK: _g2:
; CHECK: lwz r3, 0(r1)
%0 = tail call i8* @llvm.frameaddress(i32 1) ; <i8*> [#uses=1]
ret i8* %0
}
declare i8* @llvm.returnaddress(i32) nounwind readnone
define i8* @g() nounwind readnone {
entry:
; CHECK: _g:
; CHECK: mflr r0
; CHECK: stw r0, 8(r1)
; CHECK: lwz r2, 0(r1)
; CHECK: lwz r3, 8(r2)
%0 = tail call i8* @llvm.returnaddress(i32 1) ; <i8*> [#uses=1]
ret i8* %0
}