mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
37dc2d9629
Summary: A recent fix to drop dead symbols (r323633) did not work for ThinLTO distributed backends because we lose the WithGlobalValueDeadStripping set on the index during the thin link. This patch adds a new flags record to the bitcode format for the index, and serializes this flag for the combined index (it would always be 0 for the per-module index generated by the compile step, so no need to serialize the new flags record there until/unless we add another flag that applies to the per-module indexes). Generally this flag should always be set for the distributed backends, which are necessarily performed after the thin link. However, if we were to simply set this flag on the index applied to the distributed backends (invoked via clang), we would lose the ability to disable dead stripping via -compute-dead=false for debugging purposes. Reviewers: grimar, pcc Subscribers: mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D42799 llvm-svn: 324444
21 lines
818 B
LLVM
21 lines
818 B
LLVM
; REQUIRES: x86-registered-target
|
|
; RUN: opt -module-summary %s -o %t.o
|
|
|
|
; Ensure dead stripping performed flag is set on distributed index
|
|
; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \
|
|
; RUN: -r %t.o,glob,plx
|
|
; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=WITHDEAD
|
|
; WITHDEAD: <FLAGS op0=1/>
|
|
|
|
; Ensure dead stripping performed flag is not set on distributed index
|
|
; when option used to disable dead stripping computation.
|
|
; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \
|
|
; RUN: -r %t.o,glob,plx -compute-dead=false
|
|
; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=NODEAD
|
|
; NODEAD: <FLAGS op0=0/>
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
@glob = global i32 0
|