Skip to content

Commit fed7565

Browse files
committed
[COFF][LTO][NPM] Use NPM for LTO with ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
Reviewed By: hans Differential Revision: https://reviews.llvm.org/D92866
1 parent f9a27df commit fed7565

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lld/COFF/Driver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "llvm/ADT/Optional.h"
2727
#include "llvm/ADT/StringSwitch.h"
2828
#include "llvm/BinaryFormat/Magic.h"
29+
#include "llvm/Config/llvm-config.h"
2930
#include "llvm/LTO/LTO.h"
3031
#include "llvm/Object/ArchiveWriter.h"
3132
#include "llvm/Object/COFFImportFile.h"
@@ -1518,7 +1519,7 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
15181519
unsigned icfLevel =
15191520
args.hasArg(OPT_profile) ? 0 : 1; // 0: off, 1: limited, 2: on
15201521
unsigned tailMerge = 1;
1521-
bool ltoNewPM = false;
1522+
bool ltoNewPM = LLVM_ENABLE_NEW_PASS_MANAGER;
15221523
bool ltoDebugPM = false;
15231524
for (auto *arg : args.filtered(OPT_opt)) {
15241525
std::string str = StringRef(arg->getValue()).lower();

0 commit comments

Comments
 (0)