[PATCH] D39565: [ThinLTO] Ensure sanitizer passes are run
    Teresa Johnson via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Nov  2 13:32:13 PDT 2017
    
    
  
tejohnson created this revision.
Herald added subscribers: inglorion, mehdi_amini.
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.
https://reviews.llvm.org/D39565
Files:
  lib/Transforms/IPO/PassManagerBuilder.cpp
Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -537,6 +537,9 @@
   // unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes
   // during ThinLTO and perform the rest of the optimizations afterward.
   if (PrepareForThinLTO) {
+    // Ensure we perform any last passes, but do so before renaming anonymous
+    // globals in case the passes add any.
+    addExtensionsToPM(EP_OptimizerLast, MPM);
     // Rename anon globals to be able to export them in the summary.
     MPM.add(createNameAnonGlobalPass());
     return;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39565.121359.patch
Type: text/x-patch
Size: 708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171102/f2c5e940/attachment.bin>
    
    
More information about the llvm-commits
mailing list