[AnnotationRemarks] Also generate annotation remarks when using -O0.
authorFlorian Hahn <flo@fhahn.com>
Tue, 15 Dec 2020 14:44:38 +0000 (14:44 +0000)
committerFlorian Hahn <flo@fhahn.com>
Tue, 15 Dec 2020 14:46:52 +0000 (14:46 +0000)
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.

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

index 5745277..8dd30ef 100644 (file)
@@ -569,6 +569,8 @@ void PassManagerBuilder::populateModulePassManager(
       // new unnamed globals.
       MPM.add(createNameAnonGlobalPass());
     }
+
+    MPM.add(createAnnotationRemarksLegacyPass());
     return;
   }
 
index 86677c6..80ab608 100644 (file)
@@ -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