[PATCH] D108041: [LTO] Add --lto-pgo-warn-mismatch support for legacy PM
Senran Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 13 08:20:56 PDT 2021
zsrkmyn created this revision.
zsrkmyn added reviewers: YolandaCY, MaskRay, tejohnson, xur.
Herald added subscribers: ormris, wenlei, steven_wu, hiraditya, inglorion, emaste.
zsrkmyn requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108041
Files:
lld/test/COFF/pgo-warn-mismatch.ll
lld/test/ELF/lto/pgo-warn-mismatch.ll
llvm/lib/LTO/LTOBackend.cpp
Index: llvm/lib/LTO/LTOBackend.cpp
===================================================================
--- llvm/lib/LTO/LTOBackend.cpp
+++ llvm/lib/LTO/LTOBackend.cpp
@@ -317,6 +317,8 @@
legacy::PassManager passes;
passes.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis()));
+ NoPGOWarnMismatch = !Conf.PGOWarnMismatch;
+
PassManagerBuilder PMB;
PMB.LibraryInfo = new TargetLibraryInfoImpl(Triple(TM->getTargetTriple()));
if (Conf.Freestanding)
Index: lld/test/ELF/lto/pgo-warn-mismatch.ll
===================================================================
--- lld/test/ELF/lto/pgo-warn-mismatch.ll
+++ lld/test/ELF/lto/pgo-warn-mismatch.ll
@@ -6,9 +6,11 @@
;; Ensure lld generates warnings for profile cfg mismatch.
; RUN: ld.lld --lto-cs-profile-file=%t/cs.profdata --lto-pgo-warn-mismatch -shared %t/a.bc -o /dev/null 2>&1 | FileCheck %s
+; RUN: ld.lld --no-lto-legacy-pass-manager --lto-cs-profile-file=%t/cs.profdata --lto-pgo-warn-mismatch -shared %t/a.bc -o /dev/null 2>&1 | FileCheck %s
;; Ensure lld will not generate warnings for profile cfg mismatch.
; RUN: ld.lld --lto-cs-profile-file=%t/cs.profdata --no-lto-pgo-warn-mismatch -shared --fatal-warnings %t/a.bc -o /dev/null
+; RUN: ld.lld --no-lto-legacy-pass-manager --lto-cs-profile-file=%t/cs.profdata --no-lto-pgo-warn-mismatch -shared --fatal-warnings %t/a.bc -o /dev/null
; CHECK: warning: {{.*}} function control flow change detected (hash mismatch) f Hash = [[#]]
Index: lld/test/COFF/pgo-warn-mismatch.ll
===================================================================
--- lld/test/COFF/pgo-warn-mismatch.ll
+++ lld/test/COFF/pgo-warn-mismatch.ll
@@ -6,9 +6,11 @@
; Ensure lld generates warnings for profile cfg mismatch.
; RUN: lld-link /dll /noentry /export:f /lto-cs-profile-file:%t/cs.profdata /lto-pgo-warn-mismatch /opt:lldlto=2 %t/a.bc /out:%t/a.dll 2>&1 | FileCheck %s
+; RUN: lld-link /lto-legacy-pass-manager:no /dll /noentry /export:f /lto-cs-profile-file:%t/cs.profdata /lto-pgo-warn-mismatch /opt:lldlto=2 %t/a.bc /out:%t/a.dll 2>&1 | FileCheck %s
; Ensure lld will not generate warnings for profile cfg mismatch.
; RUN: lld-link /dll /noentry /export:f /lto-cs-profile-file:%t/cs.profdata /lto-pgo-warn-mismatch:no /opt:lldlto=2 %t/a.bc /out:%t/a.dll 2>&1 | count 0
+; RUN: lld-link /lto-legacy-pass-manager:no /dll /noentry /export:f /lto-cs-profile-file:%t/cs.profdata /lto-pgo-warn-mismatch:no /opt:lldlto=2 %t/a.bc /out:%t/a.dll 2>&1 | count 0
; CHECK: warning: {{.*}} function control flow change detected (hash mismatch) f Hash = [[#]]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108041.366288.patch
Type: text/x-patch
Size: 2593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210813/8d7a5beb/attachment.bin>
More information about the llvm-commits
mailing list