mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
ab043ff680
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 llvm-svn: 230794
34 lines
987 B
LLVM
34 lines
987 B
LLVM
; RUN: llc -verify-machineinstrs -mtriple=arm64-apple-ios7.0 -o - %s | FileCheck %s
|
|
@var = global void()* zeroinitializer
|
|
|
|
declare void @bar()
|
|
|
|
define void @foo() {
|
|
; CHECK-LABEL: foo:
|
|
%func = load void()*, void()** @var
|
|
|
|
; Calling a function encourages @foo to use a callee-saved register,
|
|
; which makes it a natural choice for the tail call itself. But we don't
|
|
; want that: the final "br xN" has to use a temporary or argument
|
|
; register.
|
|
call void @bar()
|
|
|
|
tail call void %func()
|
|
; CHECK: br {{x([0-79]|1[0-8])}}
|
|
ret void
|
|
}
|
|
|
|
; No matter how tempting it is, LLVM should not use x30 since that'll be
|
|
; restored to its incoming value before the "br".
|
|
define void @test_x30_tail() {
|
|
; CHECK-LABEL: test_x30_tail:
|
|
; CHECK: mov [[DEST:x[0-9]+]], x30
|
|
; CHECK: br [[DEST]]
|
|
%addr = call i8* @llvm.returnaddress(i32 0)
|
|
%faddr = bitcast i8* %addr to void()*
|
|
tail call void %faddr()
|
|
ret void
|
|
}
|
|
|
|
declare i8* @llvm.returnaddress(i32)
|