mirror of
https://github.com/RPCS3/llvm.git
synced 2026-08-27 21:00:01 -04:00
ca15d41cf2
ARM has code to recognise uses of the "returned" function parameter attribute which guarantee that the value passed to the function in r0 will be returned in r0 unmodified. IPRA replaces the regmask on call instructions, so needs to be told about this to avoid reverting the optimisation. Differential revision: https://reviews.llvm.org/D64986 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366669 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
428 B
LLVM
19 lines
428 B
LLVM
; RUN: llc -mtriple armv7a--none-eabi -enable-ipra=false < %s | FileCheck %s
|
|
; RUN: llc -mtriple armv7a--none-eabi -enable-ipra=true < %s | FileCheck %s
|
|
|
|
define i32 @returns_r0(i32 returned %a) {
|
|
entry:
|
|
call void asm sideeffect "", "~{r0}"()
|
|
ret i32 %a
|
|
}
|
|
|
|
define i32 @test(i32 %a) {
|
|
; CHECK-LABEL: test:
|
|
entry:
|
|
; CHECK-NOT: r0
|
|
; CHECK: bl returns_r0
|
|
; CHECK-NOT: r0
|
|
%b = call i32 @returns_r0(i32 %a)
|
|
ret i32 %a
|
|
}
|