Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 llvm-svn: 366669
- Loading branch information
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; 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 | ||
} |