2007-12-08 14:59:59 +08:00
|
|
|
; RUN: llvm-as < %s | llc -march=ppc32 | grep mflr
|
|
|
|
; RUN: llvm-as < %s | llc -march=ppc32 | grep lwz
|
Fix a significant code quality regression I introduced on PPC64 quite
a while ago. We now produce:
_foo:
mflr r0
std r0, 16(r1)
ld r2, 16(r1)
std r2, 0(r3)
ld r0, 16(r1)
mtlr r0
blr
instead of:
_foo:
mflr r0
std r0, 16(r1)
lis r0, 0
ori r0, r0, 16
ldx r2, r1, r0
std r2, 0(r3)
ld r0, 16(r1)
mtlr r0
blr
for:
void foo(void **X) {
*X = __builtin_return_address(0);
}
on ppc64.
llvm-svn: 44701
2007-12-08 15:04:58 +08:00
|
|
|
; RUN: llvm-as < %s | llc -march=ppc64 | grep {ld r., 16(r1)}
|
2007-12-08 14:59:59 +08:00
|
|
|
|
|
|
|
target triple = "powerpc-apple-darwin8"
|
|
|
|
|
|
|
|
define void @foo(i8** %X) {
|
|
|
|
entry:
|
|
|
|
%tmp = tail call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
|
|
|
|
store i8* %tmp, i8** %X, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.returnaddress(i32)
|
|
|
|
|