[PATCH] D135755: [LTO][Legacy] Use the same defaults as non-legacy LTO
Mike Hommey via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 01:59:07 PDT 2022
glandium created this revision.
glandium added a reviewer: pcc.
Herald added subscribers: ormris, steven_wu, hiraditya, inglorion.
Herald added a project: All.
glandium requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Fixes #57734
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135755
Files:
llvm/include/llvm/LTO/Config.h
llvm/lib/LTO/ThinLTOCodeGenerator.cpp
Index: llvm/lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -27,13 +27,14 @@
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
-#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LLVMRemarkStreamer.h"
+#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Mangler.h"
#include "llvm/IR/PassTimingInfo.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
+#include "llvm/LTO/Config.h"
#include "llvm/LTO/LTO.h"
#include "llvm/LTO/SummaryBasedOptimizations.h"
#include "llvm/MC/SubtargetFeature.h"
@@ -69,6 +70,7 @@
#endif
using namespace llvm;
+using namespace lto;
#define DEBUG_TYPE "thinlto"
@@ -1159,7 +1161,7 @@
}
}
- LLVMContext Context;
+ LTOLLVMContext Context;
Context.setDiscardValueNames(LTODiscardValueNames);
Context.enableDebugTypeODRUniquing();
auto DiagFileOrErr = lto::setupLLVMOptimizationRemarks(
Index: llvm/include/llvm/LTO/Config.h
===================================================================
--- llvm/include/llvm/LTO/Config.h
+++ llvm/include/llvm/LTO/Config.h
@@ -292,6 +292,8 @@
// FIXME: This should not be required as diagnostic handler is not callback.
struct LTOLLVMContext : LLVMContext {
+ LTOLLVMContext() : LTOLLVMContext(Config()) {}
+
LTOLLVMContext(const Config &C) : DiagHandler(C.DiagHandler) {
setDiscardValueNames(C.ShouldDiscardValueNames);
enableDebugTypeODRUniquing();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135755.467063.patch
Type: text/x-patch
Size: 1675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221012/d062442b/attachment.bin>
More information about the llvm-commits
mailing list