From 7ea3932ab1def0f5e86ac745bef0d3de09e8845f Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Tue, 15 Dec 2020 14:44:38 +0000 Subject: [PATCH] [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. --- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 2 ++ llvm/test/Other/opt-O0-pipeline.ll | 1 + 2 files changed, 3 insertions(+) diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 5745277..8dd30ef 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 86677c6..80ab608 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 -- 2.7.4