summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-02-07 04:05:59 +0000
committerTeresa Johnson <tejohnson@google.com>2018-02-07 04:05:59 +0000
commitf3681015670c531cb42bc20dbbe78cb237b055d7 (patch)
tree409b7e90c76aa0560955e60bbf4ff13bc857315c /llvm/test/Bitcode
parent37a4a8a4b128b934ed506a50474fd96030287d51 (diff)
downloadbcm5719-llvm-f3681015670c531cb42bc20dbbe78cb237b055d7.tar.gz
bcm5719-llvm-f3681015670c531cb42bc20dbbe78cb237b055d7.zip
[ThinLTO] Serialize WithGlobalValueDeadStripping index flag for distributed backends
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
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/thinlto-alias.ll1
-rw-r--r--llvm/test/Bitcode/thinlto-deadstrip-flag.ll20
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll1
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll1
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll1
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-callgraph.ll1
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-originalnames.ll1
7 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/thinlto-alias.ll b/llvm/test/Bitcode/thinlto-alias.ll
index 668c5cd22dc..a5020ff7119 100644
--- a/llvm/test/Bitcode/thinlto-alias.ll
+++ b/llvm/test/Bitcode/thinlto-alias.ll
@@ -22,6 +22,7 @@
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
+; COMBINED-NEXT: <FLAGS
; See if the call to analias is registered, using the expected value id.
; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASID:[0-9]+]] op1=-5751648690987223394/>
; COMBINED-NEXT: <VALUE_GUID
diff --git a/llvm/test/Bitcode/thinlto-deadstrip-flag.ll b/llvm/test/Bitcode/thinlto-deadstrip-flag.ll
new file mode 100644
index 00000000000..5330a25dbf1
--- /dev/null
+++ b/llvm/test/Bitcode/thinlto-deadstrip-flag.ll
@@ -0,0 +1,20 @@
+; 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
diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
index 9376e801765..bb3e8e97835 100644
--- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
@@ -24,6 +24,7 @@
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
+; COMBINED-NEXT: <FLAGS
; COMBINED-NEXT: <VALUE_GUID op0=[[FUNCID:[0-9]+]] op1=7289175272376759421/>
; COMBINED-NEXT: <VALUE_GUID
; COMBINED-NEXT: <COMBINED
diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
index d0cfa093ecd..9d4ef4cd264 100644
--- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
@@ -37,6 +37,7 @@
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
+; COMBINED-NEXT: <FLAGS
; COMBINED-NEXT: <VALUE_GUID
; COMBINED-NEXT: <VALUE_GUID
; COMBINED-NEXT: <VALUE_GUID
diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
index 4085174ae27..8793a08d3bf 100644
--- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
@@ -39,6 +39,7 @@
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
+; COMBINED-NEXT: <FLAGS
; COMBINED-NEXT: <VALUE_GUID
; COMBINED-NEXT: <VALUE_GUID
; COMBINED-NEXT: <VALUE_GUID
diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll
index 1389710e18d..8025eee5929 100644
--- a/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph.ll
@@ -26,6 +26,7 @@
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
+; COMBINED-NEXT: <FLAGS
; Only 2 VALUE_GUID since reference to undefinedglob should not be included in
; combined index.
; COMBINED-NEXT: <VALUE_GUID op0=[[FUNCID:[0-9]+]] op1=7289175272376759421/>
diff --git a/llvm/test/Bitcode/thinlto-function-summary-originalnames.ll b/llvm/test/Bitcode/thinlto-function-summary-originalnames.ll
index afc9772484e..6387e6322ec 100644
--- a/llvm/test/Bitcode/thinlto-function-summary-originalnames.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary-originalnames.ll
@@ -5,6 +5,7 @@
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
+; COMBINED-NEXT: <FLAGS
; COMBINED-NEXT: <VALUE_GUID {{.*}} op1=4947176790635855146/>
; COMBINED-NEXT: <VALUE_GUID {{.*}} op1=-6591587165810580810/>
; COMBINED-NEXT: <VALUE_GUID {{.*}} op1=-4377693495213223786/>
OpenPOWER on IntegriCloud