From 290a8398917a3d4ef521a0cfdb67e65238f0043a Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Fri, 11 Jan 2019 18:31:57 +0000 Subject: [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 --- llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll') 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 -- cgit v1.2.3