Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] Define a subtarget feature and use it to decide whether long ca…
…lls should be emitted. This is needed to enable ARM long calls for LTO and enable and disable it on a per-function basis. Out-of-tree projects currently using EnableARMLongCalls to emit long calls should start passing "+long-calls" to the feature string (see the changes made to clang in r241565). rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D9364 llvm-svn: 241566
- Loading branch information
Showing
10 changed files
with
63 additions
and
21 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
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,40 @@ | ||
; RUN: llc -march arm -mcpu cortex-a8 -relocation-model=static %s -o - | FileCheck -check-prefix=NO-OPTION %s | ||
; RUN: llc -march arm -mcpu cortex-a8 -relocation-model=static %s -o - -mattr=+long-calls | FileCheck -check-prefix=LONGCALL %s | ||
; RUN: llc -march arm -mcpu cortex-a8 -relocation-model=static %s -o - -mattr=-long-calls | FileCheck -check-prefix=NO-LONGCALL %s | ||
; RUN: llc -march arm -mcpu cortex-a8 -relocation-model=static %s -o - -O0 | FileCheck -check-prefix=NO-OPTION %s | ||
; RUN: llc -march arm -mcpu cortex-a8 -relocation-model=static %s -o - -O0 -mattr=+long-calls | FileCheck -check-prefix=LONGCALL %s | ||
; RUN: llc -march arm -mcpu cortex-a8 -relocation-model=static %s -o - -O0 -mattr=-long-calls | FileCheck -check-prefix=NO-LONGCALL %s | ||
|
||
; NO-OPTION-LABEL: {{_?}}caller0 | ||
; NO-OPTION: blx {{r[0-9]+}} | ||
|
||
; LONGCALL-LABEL: {{_?}}caller0 | ||
; LONGCALL: blx {{r[0-9]+}} | ||
|
||
; NO-LONGCALL-LABEL: {{_?}}caller0 | ||
; NO-LONGCALL: bl {{_?}}callee0 | ||
|
||
define i32 @caller0() #0 { | ||
entry: | ||
tail call void @callee0() | ||
ret i32 0 | ||
} | ||
|
||
; NO-OPTION-LABEL: {{_?}}caller1 | ||
; NO-OPTION: bl {{_?}}callee0 | ||
|
||
; LONGCALL-LABEL: {{_?}}caller1 | ||
; LONGCALL: blx {{r[0-9]+}} | ||
|
||
; NO-LONGCALL-LABEL: {{_?}}caller1 | ||
; NO-LONGCALL: bl {{_?}}callee0 | ||
|
||
define i32 @caller1() { | ||
entry: | ||
tail call void @callee0() | ||
ret i32 0 | ||
} | ||
|
||
declare void @callee0() | ||
|
||
attributes #0 = { "target-features"="+long-calls" } |