Skip to content

Commit

Permalink
[ORE] Remove ORE.emit{{.+}} functions
Browse files Browse the repository at this point in the history
Last use was killed in my previous patch. The preferred way is now to
construct the remark, pipe things to it and pass it to ORE.emit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296019 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
anemet committed Feb 23, 2017
1 parent 9e601a4 commit d779422
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 194 deletions.
128 changes: 0 additions & 128 deletions include/llvm/Analysis/OptimizationDiagnosticInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,134 +74,6 @@ class OptimizationRemarkEmitter {
/// emit* APIs.
void emit(DiagnosticInfoOptimizationBase &OptDiag);

/// Emit an optimization-applied message.
///
/// \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
/// DLoc is the debug location where the diagnostic is generated. \p V is the
/// IR Value that identifies the code region. \p Msg is the message string to
/// use.
void emitOptimizationRemark(const char *PassName, const DebugLoc &DLoc,
const Value *V, const Twine &Msg);

/// \brief Same as above but derives the IR Value for the code region and the
/// debug location from the Loop parameter \p L.
void emitOptimizationRemark(const char *PassName, Loop *L, const Twine &Msg);

/// \brief Same as above but derives the debug location and the code region
/// from the debug location and the basic block of \p Inst, respectively.
void emitOptimizationRemark(const char *PassName, Instruction *Inst,
const Twine &Msg) {
emitOptimizationRemark(PassName, Inst->getDebugLoc(), Inst->getParent(),
Msg);
}

/// Emit an optimization-missed message.
///
/// \p PassName is the name of the pass emitting the message. If
/// -Rpass-missed= is given and the name matches the regular expression in
/// -Rpass, then the remark will be emitted. \p DLoc is the debug location
/// where the diagnostic is generated. \p V is the IR Value that identifies
/// the code region. \p Msg is the message string to use. If \p IsVerbose is
/// true, the message is considered verbose and will only be emitted when
/// verbose output is turned on.
void emitOptimizationRemarkMissed(const char *PassName, const DebugLoc &DLoc,
const Value *V, const Twine &Msg,
bool IsVerbose = false);

/// \brief Same as above but derives the IR Value for the code region and the
/// debug location from the Loop parameter \p L.
void emitOptimizationRemarkMissed(const char *PassName, Loop *L,
const Twine &Msg, bool IsVerbose = false);

/// \brief Same as above but derives the debug location and the code region
/// from the debug location and the basic block of \p Inst, respectively.
void emitOptimizationRemarkMissed(const char *PassName, Instruction *Inst,
const Twine &Msg, bool IsVerbose = false) {
emitOptimizationRemarkMissed(PassName, Inst->getDebugLoc(),
Inst->getParent(), Msg, IsVerbose);
}

/// Emit an optimization analysis remark message.
///
/// \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 DLoc is the debug location
/// where the diagnostic is generated. \p V is the IR Value that identifies
/// the code region. \p Msg is the message string to use. If \p IsVerbose is
/// true, the message is considered verbose and will only be emitted when
/// verbose output is turned on.
void emitOptimizationRemarkAnalysis(const char *PassName,
const DebugLoc &DLoc, const Value *V,
const Twine &Msg, bool IsVerbose = false);

/// \brief Same as above but derives the IR Value for the code region and the
/// debug location from the Loop parameter \p L.
void emitOptimizationRemarkAnalysis(const char *PassName, Loop *L,
const Twine &Msg, bool IsVerbose = false);

/// \brief Same as above but derives the debug location and the code region
/// from the debug location and the basic block of \p Inst, respectively.
void emitOptimizationRemarkAnalysis(const char *PassName, Instruction *Inst,
const Twine &Msg,
bool IsVerbose = false) {
emitOptimizationRemarkAnalysis(PassName, Inst->getDebugLoc(),
Inst->getParent(), Msg, IsVerbose);
}

/// \brief This variant allows specifying what should be emitted for missed
/// and analysis remarks in one call.
///
/// \p PassName is the name of the pass emitting the message. If
/// -Rpass-missed= is given and \p PassName matches the regular expression, \p
/// MsgForMissedRemark is emitted.
///
/// If -Rpass-analysis= is given and \p PassName matches the regular
/// expression, \p MsgForAnalysisRemark is emitted.
///
/// The debug location and the code region is derived from \p Inst. If \p
/// IsVerbose is true, the message is considered verbose and will only be
/// emitted when verbose output is turned on.
void emitOptimizationRemarkMissedAndAnalysis(
const char *PassName, Instruction *Inst, const Twine &MsgForMissedRemark,
const Twine &MsgForAnalysisRemark, bool IsVerbose = false) {
emitOptimizationRemarkAnalysis(PassName, Inst, MsgForAnalysisRemark,
IsVerbose);
emitOptimizationRemarkMissed(PassName, Inst, MsgForMissedRemark, IsVerbose);
}

/// \brief Emit an optimization analysis remark related to floating-point
/// non-commutativity.
///
/// \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 DLoc is the debug location where the diagnostic
/// is generated.\p V is the IR Value that identifies the code region. \p Msg
/// is the message string to use.
void emitOptimizationRemarkAnalysisFPCommute(const char *PassName,
const DebugLoc &DLoc,
const Value *V,
const Twine &Msg);

/// \brief Emit an optimization analysis remark related to pointer aliasing.
///
/// \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 DLoc is the debug location where the diagnostic
/// is generated.\p V is the IR Value that identifies the code region. \p Msg
/// is the message string to use.
void emitOptimizationRemarkAnalysisAliasing(const char *PassName,
const DebugLoc &DLoc,
const Value *V, const Twine &Msg);

/// \brief Same as above but derives the IR Value for the code region and the
/// debug location from the Loop parameter \p L.
void emitOptimizationRemarkAnalysisAliasing(const char *PassName, Loop *L,
const Twine &Msg);

/// \brief Whether we allow for extra compile-time budget to perform more
/// analysis to produce fewer false positives.
///
Expand Down
66 changes: 0 additions & 66 deletions lib/Analysis/OptimizationDiagnosticInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,72 +167,6 @@ void OptimizationRemarkEmitter::emit(
F->getContext().diagnose(OptDiag);
}

void OptimizationRemarkEmitter::emitOptimizationRemark(const char *PassName,
const DebugLoc &DLoc,
const Value *V,
const Twine &Msg) {
LLVMContext &Ctx = F->getContext();
Ctx.diagnose(OptimizationRemark(PassName, *F, DLoc, Msg, computeHotness(V)));
}

void OptimizationRemarkEmitter::emitOptimizationRemark(const char *PassName,
Loop *L,
const Twine &Msg) {
emitOptimizationRemark(PassName, L->getStartLoc(), L->getHeader(), Msg);
}

void OptimizationRemarkEmitter::emitOptimizationRemarkMissed(
const char *PassName, const DebugLoc &DLoc, const Value *V,
const Twine &Msg, bool IsVerbose) {
LLVMContext &Ctx = F->getContext();
if (!IsVerbose || shouldEmitVerbose())
Ctx.diagnose(
OptimizationRemarkMissed(PassName, *F, DLoc, Msg, computeHotness(V)));
}

void OptimizationRemarkEmitter::emitOptimizationRemarkMissed(
const char *PassName, Loop *L, const Twine &Msg, bool IsVerbose) {
emitOptimizationRemarkMissed(PassName, L->getStartLoc(), L->getHeader(), Msg,
IsVerbose);
}

void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysis(
const char *PassName, const DebugLoc &DLoc, const Value *V,
const Twine &Msg, bool IsVerbose) {
LLVMContext &Ctx = F->getContext();
if (!IsVerbose || shouldEmitVerbose())
Ctx.diagnose(
OptimizationRemarkAnalysis(PassName, *F, DLoc, Msg, computeHotness(V)));
}

void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysis(
const char *PassName, Loop *L, const Twine &Msg, bool IsVerbose) {
emitOptimizationRemarkAnalysis(PassName, L->getStartLoc(), L->getHeader(),
Msg, IsVerbose);
}

void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysisFPCommute(
const char *PassName, const DebugLoc &DLoc, const Value *V,
const Twine &Msg) {
LLVMContext &Ctx = F->getContext();
Ctx.diagnose(OptimizationRemarkAnalysisFPCommute(PassName, *F, DLoc, Msg,
computeHotness(V)));
}

void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysisAliasing(
const char *PassName, const DebugLoc &DLoc, const Value *V,
const Twine &Msg) {
LLVMContext &Ctx = F->getContext();
Ctx.diagnose(OptimizationRemarkAnalysisAliasing(PassName, *F, DLoc, Msg,
computeHotness(V)));
}

void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysisAliasing(
const char *PassName, Loop *L, const Twine &Msg) {
emitOptimizationRemarkAnalysisAliasing(PassName, L->getStartLoc(),
L->getHeader(), Msg);
}

OptimizationRemarkEmitterWrapperPass::OptimizationRemarkEmitterWrapperPass()
: FunctionPass(ID) {
initializeOptimizationRemarkEmitterWrapperPassPass(
Expand Down

0 comments on commit d779422

Please sign in to comment.