Skip to content

Commit dcf64df

Browse files
committed
[ThinLTO] Ensure sanitizer passes are run
Summary: In ThinLTO compilation, we exit populateModulePassManager early and were not adding PM extension passes meant to run at the end of the pipeline. This includes sanitizer passes. Add these passes before the early exit. A test will be added to projects/compiler-rt. Reviewers: pcc Subscribers: mehdi_amini, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D39565 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317714 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 9799e6f commit dcf64df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Transforms/IPO/PassManagerBuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ void PassManagerBuilder::populateModulePassManager(
548548
// unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes
549549
// during ThinLTO and perform the rest of the optimizations afterward.
550550
if (PrepareForThinLTO) {
551+
// Ensure we perform any last passes, but do so before renaming anonymous
552+
// globals in case the passes add any.
553+
addExtensionsToPM(EP_OptimizerLast, MPM);
551554
// Rename anon globals to be able to export them in the summary.
552555
MPM.add(createNameAnonGlobalPass());
553556
return;

0 commit comments

Comments
 (0)