[llvm-branch-commits] [llvm] 7ea3932 - [AnnotationRemarks] Also generate annotation remarks when using -O0.

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 15 06:51:20 PST 2020


Author: Florian Hahn
Date: 2020-12-15T14:46:52Z
New Revision: 7ea3932ab1def0f5e86ac745bef0d3de09e8845f

URL: https://github.com/llvm/llvm-project/commit/7ea3932ab1def0f5e86ac745bef0d3de09e8845f
DIFF: https://github.com/llvm/llvm-project/commit/7ea3932ab1def0f5e86ac745bef0d3de09e8845f.diff

LOG: [AnnotationRemarks] Also generate annotation remarks when using -O0.

The AnnotationRemarks pass is already run at the end of the module
pipeline. This patch also adds it before bailing out for -O0, so remarks
are also generated with -O0.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
    llvm/test/Other/opt-O0-pipeline.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 574527763a9c..8dd30ef82bc3 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -569,6 +569,8 @@ void PassManagerBuilder::populateModulePassManager(
       // new unnamed globals.
       MPM.add(createNameAnonGlobalPass());
     }
+
+    MPM.add(createAnnotationRemarksLegacyPass());
     return;
   }
 

diff  --git a/llvm/test/Other/opt-O0-pipeline.ll b/llvm/test/Other/opt-O0-pipeline.ll
index 86677c683c42..80ab608b05ce 100644
--- a/llvm/test/Other/opt-O0-pipeline.ll
+++ b/llvm/test/Other/opt-O0-pipeline.ll
@@ -25,6 +25,7 @@
 ; CHECK-NEXT:       Inliner for always_inline functions
 ;                   A No-Op Barrier Pass
 ; CHECK:            FunctionPass Manager
+; CHECK-NEXT:         Annotation Remarks
 ; CHECK-NEXT:         Module Verifier
 ; CHECK-NEXT:     Bitcode Writer
 


        


More information about the llvm-branch-commits mailing list