aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTOBackend.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2020-12-01 10:14:38 -0800
committerArthur Eubanks <aeubanks@google.com>2020-12-01 10:14:53 -0800
commit26d3aaeb3aac39329dd845bd0012ad961653dbc6 (patch)
treedf13a241b135f13aef4a33f33e70f531b35d4e10 /llvm/lib/LTO/LTOBackend.cpp
parentc94af03f7f3223e917b00e1c0263a3b8d90b76bc (diff)
downloadllvm-26d3aaeb3aac39329dd845bd0012ad961653dbc6.zip
llvm-26d3aaeb3aac39329dd845bd0012ad961653dbc6.tar.gz
llvm-26d3aaeb3aac39329dd845bd0012ad961653dbc6.tar.bz2
[LTO][NewPM] Run verifier when doing LTO
This matches the legacy PM. Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D92138
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 3f082fd..65aaa8d 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -250,7 +250,9 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
ModulePassManager MPM(Conf.DebugPassManager);
- // FIXME (davide): verify the input.
+
+ if (!Conf.DisableVerify)
+ MPM.addPass(VerifierPass());
PassBuilder::OptimizationLevel OL;
@@ -272,12 +274,14 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,
}
if (IsThinLTO)
- MPM = PB.buildThinLTODefaultPipeline(OL, ImportSummary);
+ MPM.addPass(PB.buildThinLTODefaultPipeline(OL, ImportSummary));
else
- MPM = PB.buildLTODefaultPipeline(OL, ExportSummary);
- MPM.run(Mod, MAM);
+ MPM.addPass(PB.buildLTODefaultPipeline(OL, ExportSummary));
- // FIXME (davide): verify the output.
+ if (!Conf.DisableVerify)
+ MPM.addPass(VerifierPass());
+
+ MPM.run(Mod, MAM);
}
static void runNewPMCustomPasses(const Config &Conf, Module &Mod,