Files
llvm/test/CodeGen/ARM/ipra-r0-returned.ll
Oliver Stannard ca15d41cf2 [IPRA][ARM] Make use of the "returned" parameter attribute
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
2019-07-22 08:44:36 +00:00

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
}