r369550 - [LTO] Always mark regular LTO units with EnableSplitLTOUnit=1 under the new pass manager

Leonard Chan via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 21 10:24:14 PDT 2019


Author: leonardchan
Date: Wed Aug 21 10:24:14 2019
New Revision: 369550

URL: http://llvm.org/viewvc/llvm-project?rev=369550&view=rev
Log:
[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

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/test/CodeGen/split-lto-unit.c

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=369550&r1=369549&r2=369550&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Wed Aug 21 10:24:14 2019
@@ -1291,7 +1291,7 @@ void EmitAssemblyHelper::EmitAssemblyWit
         if (!TheModule->getModuleFlag("ThinLTO"))
           TheModule->addModuleFlag(Module::Error, "ThinLTO", uint32_t(0));
         TheModule->addModuleFlag(Module::Error, "EnableSplitLTOUnit",
-                                 CodeGenOpts.EnableSplitLTOUnit);
+                                 uint32_t(1));
       }
       MPM.addPass(
           BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, EmitLTOSummary));

Modified: cfe/trunk/test/CodeGen/split-lto-unit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/split-lto-unit.c?rev=369550&r1=369549&r2=369550&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/split-lto-unit.c (original)
+++ cfe/trunk/test/CodeGen/split-lto-unit.c Wed Aug 21 10:24:14 2019
@@ -7,6 +7,7 @@
 // SPLIT: !{i32 1, !"EnableSplitLTOUnit", i32 1}
 //
 // ; Check that regular LTO has EnableSplitLTOUnit = 1
-// 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
+// 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
+// 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
 
 int main() {}




More information about the cfe-commits mailing list