diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-01-11 18:31:57 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-01-11 18:31:57 +0000 |
commit | 290a8398917a3d4ef521a0cfdb67e65238f0043a (patch) | |
tree | 991a2afdc913f1083ccd134681d4b1f26cb90e83 /llvm/test/Transforms/ThinLTOBitcodeWriter | |
parent | 15b58ce5d43e43b72517d78fee3476fe1a3a1672 (diff) | |
download | bcm5719-llvm-290a8398917a3d4ef521a0cfdb67e65238f0043a.tar.gz bcm5719-llvm-290a8398917a3d4ef521a0cfdb67e65238f0043a.zip |
[LTO] Record whether LTOUnit splitting is enabled in index
Summary:
Records in the module summary index whether the bitcode was compiled
with the option necessary to enable splitting the LTO unit
(e.g. -fsanitize=cfi, -fwhole-program-vtables, or -fsplit-lto-unit).
The information is passed down to the ModuleSummaryIndex builder via a
new module flag "EnableSplitLTOUnit", which is propagated onto a flag
on the summary index.
This is then used during the LTO link to check whether all linked
summaries were built with the same value of this flag. If not, an error
is issued when we detect a situation requiring whole program visibility
of the class hierarchy. This is the case when both of the following
conditions are met:
1) We are performing LowerTypeTests or Whole Program Devirtualization.
2) There are type tests or type checked loads in the code.
Note I have also changed the ThinLTOBitcodeWriter to also gate the
module splitting on the value of this flag.
Reviewers: pcc
Subscribers: ormris, mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, dang, llvm-commits
Differential Revision: https://reviews.llvm.org/D53890
llvm-svn: 350948
Diffstat (limited to 'llvm/test/Transforms/ThinLTOBitcodeWriter')
14 files changed, 17 insertions, 16 deletions
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll index eeda7932449..fb239b0a8a2 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll index caea48e0a54..a43fa1cf3eb 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=THIN %s ; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=MERGED %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll index eb0cbe78a73..200d494f247 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK0 %s ; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK1 %s ; CHECK0-NOT: @{{.*}}anon{{.*}}= diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll index 119b8219bab..a1dbd963296 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK1 %s target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll index 661d0739401..c405c369e05 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll @@ -1,7 +1,7 @@ ; Test for a bug specific to the new pass manager where we may build a domtree ; to make more precise AA queries for functions. ; -; RUN: opt -aa-pipeline=default -passes='no-op-module' -debug-pass-manager -thinlto-bc -o %t %s +; RUN: opt -aa-pipeline=default -passes='no-op-module' -debug-pass-manager -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll index a43db9a3755..290df00fa9e 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o %t0 %t ; RUN: llvm-modextract -b -n 1 -o %t1 %t ; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll index 6d18c4f6f65..42a06bdf2bf 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o %t0 %t ; RUN: llvm-modextract -b -n 1 -o %t1 %t ; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll index fbe618f08e3..02fc3d18850 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o %t0 %t ; RUN: llvm-modextract -b -n 1 -o %t1 %t ; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll index 087796b5031..7ebb30ae1aa 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll index 66d37d5e8ae..fcf575188f7 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split.ll index 08ed92e7ebe..5502f7a2632 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split.ll @@ -1,6 +1,6 @@ ; Generate bitcode files with summary, as well as minimized bitcode without ; the debug metadata for the thin link. -; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s +; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o %t0.bc %t ; RUN: llvm-modextract -b -n 1 -o %t1.bc %t ; RUN: llvm-modextract -b -n 0 -o %t0.thinlink.bc %t2 diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/symver.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/symver.ll index 078825cf468..8acdd0c6a68 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/symver.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/symver.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck %s ; The target assembly parser is required to parse the symver directives diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll index 5413e0f6188..46c87bc4e1f 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s +; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s ; RUN: llvm-dis -o - %t | FileCheck %s ; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s ; When not splitting the module, the thin link bitcode file should simply be a @@ -28,7 +28,8 @@ define void @h() comdat { ret void } -; CHECK: !llvm.module.flags = !{![[FLAG:[0-9]+]]} -; CHECK: ![[FLAG]] = !{i32 1, !"ThinLTO", i32 0} +; CHECK: !llvm.module.flags = !{![[FLAG1:[0-9]+]], ![[FLAG2:[0-9]+]]} +; CHECK: ![[FLAG1]] = !{i32 1, !"EnableSplitLTOUnit", i32 1} +; CHECK: ![[FLAG2]] = !{i32 1, !"ThinLTO", i32 0} !0 = !{i32 0, !"typeid"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/x86/module-asm.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/x86/module-asm.ll index 15e47785cbe..587ab3fbb50 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/x86/module-asm.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/x86/module-asm.ll @@ -1,4 +1,4 @@ -; RUN: opt -thinlto-bc -o %t %s +; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s ; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s ; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s |