forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TailCallElim] Add tailcall elimination pass to LTO pipelines
LTO provides additional opportunities for tailcall elimination due to link-time inlining and visibility of nocapture attribute. Testing showed negligible impact on compilation times. Differential Revision: https://reviews.llvm.org/D58391 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356511 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Robert Lougher
committed
Mar 19, 2019
1 parent
94c6fbf
commit e9a0d4a
Showing
4 changed files
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; Check that the LTO pipelines add the Tail Call Elimination pass. | ||
|
||
; RUN: llvm-as < %s > %t1 | ||
; RUN: llvm-lto -o %t2 %t1 --exported-symbol=foo -save-merged-module | ||
; RUN: llvm-dis < %t2.merged.bc | FileCheck %s | ||
|
||
; RUN: llvm-lto2 run -r %t1,foo,plx -r %t1,bar,plx -o %t3 %t1 -save-temps | ||
; RUN: llvm-dis < %t3.0.4.opt.bc | FileCheck %s | ||
|
||
; RUN: llvm-lto2 run -r %t1,foo,plx -r %t1,bar,plx -o %t4 %t1 -save-temps -use-new-pm | ||
; RUN: llvm-dis < %t4.0.4.opt.bc | FileCheck %s | ||
|
||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @foo() { | ||
; CHECK: tail call void @bar() | ||
call void @bar() | ||
ret void | ||
} | ||
|
||
declare void @bar() |
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