Skip to content

Commit 19ec31d

Browse files
committedAug 21, 2019
[LTO] Always mark regular LTO units with EnableSplitLTOUnit=1 under the new pass manager
Match the behavior of D65009 under the new pass manager. This addresses the test clang/test/CodeGen/split-lto-unit.c when running under the new PM. Differential Revision: https://reviews.llvm.org/D66488 llvm-svn: 369550
1 parent 01a4136 commit 19ec31d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎clang/lib/CodeGen/BackendUtil.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
12911291
if (!TheModule->getModuleFlag("ThinLTO"))
12921292
TheModule->addModuleFlag(Module::Error, "ThinLTO", uint32_t(0));
12931293
TheModule->addModuleFlag(Module::Error, "EnableSplitLTOUnit",
1294-
CodeGenOpts.EnableSplitLTOUnit);
1294+
uint32_t(1));
12951295
}
12961296
MPM.addPass(
12971297
BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, EmitLTOSummary));

‎clang/test/CodeGen/split-lto-unit.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// SPLIT: !{i32 1, !"EnableSplitLTOUnit", i32 1}
88
//
99
// ; Check that regular LTO has EnableSplitLTOUnit = 1
10-
// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
10+
// RUN: %clang_cc1 -fno-experimental-new-pass-manager -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
11+
// RUN: %clang_cc1 -fexperimental-new-pass-manager -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
1112

1213
int main() {}

0 commit comments

Comments
 (0)
Please sign in to comment.