[llvm] r311380 - [ORE] Remove Old Optimization Remark API

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 13:30:45 PDT 2017


Author: lenary
Date: Mon Aug 21 13:30:44 2017
New Revision: 311380

URL: http://llvm.org/viewvc/llvm-project?rev=311380&view=rev
Log:
[ORE] Remove Old Optimization Remark API

Summary: https://bugs.llvm.org/show_bug.cgi?id=33789

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36972

Modified:
    llvm/trunk/include/llvm/Analysis/OptimizationDiagnosticInfo.h
    llvm/trunk/include/llvm/IR/DiagnosticInfo.h
    llvm/trunk/lib/IR/DiagnosticInfo.cpp

Modified: llvm/trunk/include/llvm/Analysis/OptimizationDiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/OptimizationDiagnosticInfo.h?rev=311380&r1=311379&r2=311380&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/OptimizationDiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/OptimizationDiagnosticInfo.h Mon Aug 21 13:30:44 2017
@@ -69,9 +69,6 @@ public:
 
   /// \brief Output the remark via the diagnostic handler and to the
   /// optimization record file.
-  ///
-  /// This is the new interface that should be now used rather than the legacy
-  /// emit* APIs.
   void emit(DiagnosticInfoOptimizationBase &OptDiag);
 
   /// \brief Whether we allow for extra compile-time budget to perform more

Modified: llvm/trunk/include/llvm/IR/DiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DiagnosticInfo.h?rev=311380&r1=311379&r2=311380&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DiagnosticInfo.h Mon Aug 21 13:30:44 2017
@@ -627,11 +627,6 @@ private:
                      const DiagnosticLocation &Loc, const Twine &Msg)
       : DiagnosticInfoIROptimization(DK_OptimizationRemark, DS_Remark, PassName,
                                      Fn, Loc, Msg) {}
-
-  friend void emitOptimizationRemark(LLVMContext &Ctx, const char *PassName,
-                                     const Function &Fn,
-                                     const DiagnosticLocation &Loc,
-                                     const Twine &Msg);
 };
 
 /// Diagnostic information for missed-optimization remarks.
@@ -675,12 +670,6 @@ private:
                            const DiagnosticLocation &Loc, const Twine &Msg)
       : DiagnosticInfoIROptimization(DK_OptimizationRemarkMissed, DS_Remark,
                                      PassName, Fn, Loc, Msg) {}
-
-  friend void emitOptimizationRemarkMissed(LLVMContext &Ctx,
-                                           const char *PassName,
-                                           const Function &Fn,
-                                           const DiagnosticLocation &Loc,
-                                           const Twine &Msg);
 };
 
 /// Diagnostic information for optimization analysis remarks.
@@ -752,12 +741,6 @@ private:
                              const DiagnosticLocation &Loc, const Twine &Msg)
       : DiagnosticInfoIROptimization(DK_OptimizationRemarkAnalysis, DS_Remark,
                                      PassName, Fn, Loc, Msg) {}
-
-  friend void emitOptimizationRemarkAnalysis(LLVMContext &Ctx,
-                                             const char *PassName,
-                                             const Function &Fn,
-                                             const DiagnosticLocation &Loc,
-                                             const Twine &Msg);
 };
 
 /// Diagnostic information for optimization analysis remarks related to
@@ -799,10 +782,6 @@ private:
                                       const Twine &Msg)
       : OptimizationRemarkAnalysis(DK_OptimizationRemarkAnalysisFPCommute,
                                    PassName, Fn, Loc, Msg) {}
-
-  friend void emitOptimizationRemarkAnalysisFPCommute(
-      LLVMContext &Ctx, const char *PassName, const Function &Fn,
-      const DiagnosticLocation &Loc, const Twine &Msg);
 };
 
 /// Diagnostic information for optimization analysis remarks related to
@@ -843,10 +822,6 @@ private:
                                      const Twine &Msg)
       : OptimizationRemarkAnalysis(DK_OptimizationRemarkAnalysisAliasing,
                                    PassName, Fn, Loc, Msg) {}
-
-  friend void emitOptimizationRemarkAnalysisAliasing(
-      LLVMContext &Ctx, const char *PassName, const Function &Fn,
-      const DiagnosticLocation &Loc, const Twine &Msg);
 };
 
 /// Diagnostic information for machine IR parser.
@@ -889,74 +864,6 @@ public:
 // Create wrappers for C Binding types (see CBindingWrapping.h).
 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DiagnosticInfo, LLVMDiagnosticInfoRef)
 
-/// \brief Legacy interface to emit an optimization-applied message.  Use
-/// (Machine)OptimizationRemarkEmitter instead.
-///
-/// \p PassName is the name of the pass emitting the message. If -Rpass= is
-/// given and \p PassName matches the regular expression in -Rpass, then the
-/// remark will be emitted. \p Fn is the function triggering the remark, \p Loc
-/// is the debug location where the diagnostic is generated. \p Msg is the
-/// message string to use.
-void emitOptimizationRemark(LLVMContext &Ctx, const char *PassName,
-                            const Function &Fn, const DiagnosticLocation &Loc,
-                            const Twine &Msg);
-
-/// \brief Legacy interface to emit an optimization-missed message.  Use
-/// (Machine)OptimizationRemarkEmitter instead.
-///
-/// \p PassName is the name of the pass emitting the message. If -Rpass-missed=
-/// is given and \p PassName matches the regular expression in -Rpass, then the
-/// remark will be emitted. \p Fn is the function triggering the remark, \p Loc
-/// is the debug location where the diagnostic is generated. \p Msg is the
-/// message string to use.
-void emitOptimizationRemarkMissed(LLVMContext &Ctx, const char *PassName,
-                                  const Function &Fn,
-                                  const DiagnosticLocation &Loc,
-                                  const Twine &Msg);
-
-/// \brief Legacy interface to emit an optimization analysis remark message.
-/// Use (Machine)OptimizationRemarkEmitter instead.
-///
-/// \p PassName is the name of the pass emitting the message. If
-/// -Rpass-analysis= is given and \p PassName matches the regular expression in
-/// -Rpass, then the remark will be emitted. \p Fn is the function triggering
-/// the remark, \p Loc is the debug location where the diagnostic is
-/// generated. \p Msg is the message string to use.
-void emitOptimizationRemarkAnalysis(LLVMContext &Ctx, const char *PassName,
-                                    const Function &Fn,
-                                    const DiagnosticLocation &Loc,
-                                    const Twine &Msg);
-
-/// \brief Legacy interface to emit an optimization analysis remark related to
-/// messages about floating-point non-commutativity.  Use
-/// (Machine)OptimizationRemarkEmitter instead.
-///
-/// \p PassName is the name of the pass emitting the message. If
-/// -Rpass-analysis= is given and \p PassName matches the regular expression in
-/// -Rpass, then the remark will be emitted. \p Fn is the function triggering
-/// the remark, \p Loc is the debug location where the diagnostic is
-/// generated. \p Msg is the message string to use.
-void emitOptimizationRemarkAnalysisFPCommute(LLVMContext &Ctx,
-                                             const char *PassName,
-                                             const Function &Fn,
-                                             const DiagnosticLocation &Loc,
-                                             const Twine &Msg);
-
-/// \brief Legacy interface to emit an optimization analysis remark related to
-/// messages about pointer aliasing.  Use (Machine)OptimizationRemarkEmitter
-/// instead.
-///
-/// \p PassName is the name of the pass emitting the message.
-/// If -Rpass-analysis= is given and \p PassName matches the regular expression
-/// in -Rpass, then the remark will be emitted. \p Fn is the function triggering
-/// the remark, \p Loc is the debug location where the diagnostic is generated.
-/// \p Msg is the message string to use.
-void emitOptimizationRemarkAnalysisAliasing(LLVMContext &Ctx,
-                                            const char *PassName,
-                                            const Function &Fn,
-                                            const DiagnosticLocation &Loc,
-                                            const Twine &Msg);
-
 /// Diagnostic information for optimization failures.
 class DiagnosticInfoOptimizationFailure : public DiagnosticInfoIROptimization {
 public:

Modified: llvm/trunk/lib/IR/DiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DiagnosticInfo.cpp?rev=311380&r1=311379&r2=311380&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/IR/DiagnosticInfo.cpp Mon Aug 21 13:30:44 2017
@@ -45,14 +45,11 @@ namespace {
 
 /// \brief Regular expression corresponding to the value given in one of the
 /// -pass-remarks* command line flags. Passes whose name matches this regexp
-/// will emit a diagnostic when calling the associated diagnostic function
-/// (emitOptimizationRemark, emitOptimizationRemarkMissed or
-/// emitOptimizationRemarkAnalysis).
+/// will emit a diagnostic via ORE->emit(...);
 struct PassRemarksOpt {
   std::shared_ptr<Regex> Pattern;
 
   void operator=(const std::string &Val) {
-    // Create a regexp object to match pass names for emitOptimizationRemark.
     if (!Val.empty()) {
       Pattern = std::make_shared<Regex>(Val);
       std::string RegexError;
@@ -71,7 +68,7 @@ static PassRemarksOpt PassRemarksMissedO
 static PassRemarksOpt PassRemarksAnalysisOptLoc;
 
 // -pass-remarks
-//    Command line flag to enable emitOptimizationRemark()
+//    Command line flag to enable optimization remarks
 static cl::opt<PassRemarksOpt, true, cl::parser<std::string>>
 PassRemarks("pass-remarks", cl::value_desc("pattern"),
             cl::desc("Enable optimization remarks from passes whose name match "
@@ -80,7 +77,7 @@ PassRemarks("pass-remarks", cl::value_de
             cl::ZeroOrMore);
 
 // -pass-remarks-missed
-//    Command line flag to enable emitOptimizationRemarkMissed()
+//    Command line flag to enable missed optimization remarks
 static cl::opt<PassRemarksOpt, true, cl::parser<std::string>> PassRemarksMissed(
     "pass-remarks-missed", cl::value_desc("pattern"),
     cl::desc("Enable missed optimization remarks from passes whose name match "
@@ -89,7 +86,7 @@ static cl::opt<PassRemarksOpt, true, cl:
     cl::ZeroOrMore);
 
 // -pass-remarks-analysis
-//    Command line flag to enable emitOptimizationRemarkAnalysis()
+//    Command line flag to enable optimization analysis remarks
 static cl::opt<PassRemarksOpt, true, cl::parser<std::string>>
 PassRemarksAnalysis(
     "pass-remarks-analysis", cl::value_desc("pattern"),
@@ -334,42 +331,6 @@ void DiagnosticInfoMIRParser::print(Diag
   DP << Diagnostic;
 }
 
-void llvm::emitOptimizationRemark(LLVMContext &Ctx, const char *PassName,
-                                  const Function &Fn,
-                                  const DiagnosticLocation &Loc,
-                                  const Twine &Msg) {
-  Ctx.diagnose(OptimizationRemark(PassName, Fn, Loc, Msg));
-}
-
-void llvm::emitOptimizationRemarkMissed(LLVMContext &Ctx, const char *PassName,
-                                        const Function &Fn,
-                                        const DiagnosticLocation &Loc,
-                                        const Twine &Msg) {
-  Ctx.diagnose(OptimizationRemarkMissed(PassName, Fn, Loc, Msg));
-}
-
-void llvm::emitOptimizationRemarkAnalysis(LLVMContext &Ctx,
-                                          const char *PassName,
-                                          const Function &Fn,
-                                          const DiagnosticLocation &Loc,
-                                          const Twine &Msg) {
-  Ctx.diagnose(OptimizationRemarkAnalysis(PassName, Fn, Loc, Msg));
-}
-
-void llvm::emitOptimizationRemarkAnalysisFPCommute(
-    LLVMContext &Ctx, const char *PassName, const Function &Fn,
-    const DiagnosticLocation &Loc, const Twine &Msg) {
-  Ctx.diagnose(OptimizationRemarkAnalysisFPCommute(PassName, Fn, Loc, Msg));
-}
-
-void llvm::emitOptimizationRemarkAnalysisAliasing(LLVMContext &Ctx,
-                                                  const char *PassName,
-                                                  const Function &Fn,
-                                                  const DiagnosticLocation &Loc,
-                                                  const Twine &Msg) {
-  Ctx.diagnose(OptimizationRemarkAnalysisAliasing(PassName, Fn, Loc, Msg));
-}
-
 DiagnosticInfoOptimizationFailure::DiagnosticInfoOptimizationFailure(
     const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
     const Value *CodeRegion)




More information about the llvm-commits mailing list