Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ThinLTO] - Stop internalizing and drop non-prevailing symbols.
Implementation marks non-prevailing symbols as not live in the summary. Then them are dropped in backends. Fixes https://bugs.llvm.org/show_bug.cgi?id=35938 Differential revision: https://reviews.llvm.org/D42107 llvm-svn: 323633
- Loading branch information
George Rimar
committed
Jan 29, 2018
1 parent
62b6235
commit eaf5172
Showing
11 changed files
with
160 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @bar() { | ||
ret void | ||
} |
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,37 @@ | ||
; RUN: opt -module-summary %s -o %t1.o | ||
; RUN: opt -module-summary -o %t2.o %S/Inputs/not-prevailing.ll | ||
; RUN: llvm-lto2 run -o %t3.o %t1.o %t2.o -r %t1.o,foo,x -r %t1.o,zed,px -r %t1.o,bar,x \ | ||
; RUN: -r %t2.o,bar,x -save-temps | ||
|
||
; Check that 'foo' and 'bar' were not inlined. | ||
; CHECK: zed: | ||
; CHECK-NEXT: {{.*}} pushq %rbx | ||
; CHECK-NEXT: {{.*}} callq 0 <zed+0x6> | ||
; CHECK-NEXT: {{.*}} movl %eax, %ebx | ||
; CHECK-NEXT: {{.*}} callq 0 <zed+0xd> | ||
; CHECK-NEXT: {{.*}} movl %ebx, %eax | ||
; CHECK-NEXT: {{.*}} popq %rbx | ||
; CHECK-NEXT: {{.*}} retq | ||
|
||
; RUN: llvm-objdump -d %t3.o.1 | FileCheck %s | ||
; RUN: llvm-readelf --symbols %t3.o.1 | FileCheck %s --check-prefix=SYMBOLS | ||
|
||
; Check that 'foo' and 'bar' produced as undefined. | ||
; SYMBOLS: NOTYPE GLOBAL DEFAULT UND bar | ||
; SYMBOLS: NOTYPE GLOBAL DEFAULT UND foo | ||
; SYMBOLS: FUNC GLOBAL DEFAULT 2 zed | ||
|
||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define weak i32 @foo() { | ||
ret i32 65 | ||
} | ||
|
||
declare void @bar() | ||
|
||
define i32 @zed() { | ||
%1 = tail call i32 @foo() | ||
call void @bar() | ||
ret i32 %1 | ||
} |
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