mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-21 12:56:10 +00:00

Summary: If we have a symbol with (linkonce|weak)_odr linkage, we do not want to dead strip it even it is not prevailing. IR level (linkonce|weak)_odr symbol can become non-prevailing when we mix ELF objects and IR objects where the (linkonce|weak)_odr symbol in the ELF object is prevailing and the ones in the IR objects are not. Stripping them will prevent us from doing optimizations with them. By not dead stripping them, We will convert these symbols to available_externally linkage as a result of non-prevailing and eventually dropping them after inlining. I modified cache-prevailing.ll to use linkonce linkage as it is testing whether cache prevailing bit is effective or not, not we should treat linkonce_odr alive or not Reviewers: tejohnson, pcc Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D52893 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343970 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
544 B
LLVM
19 lines
544 B
LLVM
; RUN: opt -module-summary %s -o %t1.bc
|
|
; RUN: opt -module-summary -o %t2.bc %S/Inputs/not-prevailing.ll
|
|
; RUN: not llvm-lto2 run -o %t3.bc %t1.bc %t2.bc -r %t1.bc,bar,px \
|
|
; RUN: -r %t1.bc,foo,x -r %t2.bc,foo,x -save-temps 2>&1 | FileCheck %s
|
|
|
|
; CHECK: Interposable and available_externally/linkonce_odr/weak_odr symbol
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
define available_externally i32 @foo() {
|
|
ret i32 1
|
|
}
|
|
|
|
define i32 @bar() {
|
|
%1 = call i32 @foo()
|
|
ret i32 %1
|
|
}
|