[llvm] r282544 - Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 27 15:19:23 PDT 2016
Author: anemet
Date: Tue Sep 27 17:19:23 2016
New Revision: 282544
URL: http://llvm.org/viewvc/llvm-project?rev=282544&view=rev
Log:
Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC
With the new streaming interface, these class names need to be typed a
lot and it's way too looong.
Modified:
llvm/trunk/include/llvm/IR/DiagnosticInfo.h
llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp
llvm/trunk/lib/IR/DiagnosticInfo.cpp
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
Modified: llvm/trunk/include/llvm/IR/DiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DiagnosticInfo.h?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DiagnosticInfo.h Tue Sep 27 17:19:23 2016
@@ -481,7 +481,7 @@ private:
};
/// Diagnostic information for applied optimization remarks.
-class DiagnosticInfoOptimizationRemark : public DiagnosticInfoOptimizationBase {
+class OptimizationRemark : public DiagnosticInfoOptimizationBase {
public:
/// \p PassName is the name of the pass emitting this diagnostic. If
/// this name matches the regular expression given in -Rpass=, then the
@@ -491,9 +491,9 @@ public:
/// will include the source code location. \p Msg is the message to show.
/// Note that this class does not copy this message, so this reference
/// must be valid for the whole life time of the diagnostic.
- DiagnosticInfoOptimizationRemark(const char *PassName, const Function &Fn,
- const DebugLoc &DLoc, const Twine &Msg,
- Optional<uint64_t> Hotness = None)
+ OptimizationRemark(const char *PassName, const Function &Fn,
+ const DebugLoc &DLoc, const Twine &Msg,
+ Optional<uint64_t> Hotness = None)
: DiagnosticInfoOptimizationBase(DK_OptimizationRemark, DS_Remark,
PassName, Fn, DLoc, Msg, Hotness) {}
@@ -506,8 +506,7 @@ public:
};
/// Diagnostic information for missed-optimization remarks.
-class DiagnosticInfoOptimizationRemarkMissed
- : public DiagnosticInfoOptimizationBase {
+class OptimizationRemarkMissed : public DiagnosticInfoOptimizationBase {
public:
/// \p PassName is the name of the pass emitting this diagnostic. If
/// this name matches the regular expression given in -Rpass-missed=, then the
@@ -517,10 +516,9 @@ public:
/// will include the source code location. \p Msg is the message to show.
/// Note that this class does not copy this message, so this reference
/// must be valid for the whole life time of the diagnostic.
- DiagnosticInfoOptimizationRemarkMissed(const char *PassName,
- const Function &Fn,
- const DebugLoc &DLoc, const Twine &Msg,
- Optional<uint64_t> Hotness = None)
+ OptimizationRemarkMissed(const char *PassName, const Function &Fn,
+ const DebugLoc &DLoc, const Twine &Msg,
+ Optional<uint64_t> Hotness = None)
: DiagnosticInfoOptimizationBase(DK_OptimizationRemarkMissed, DS_Remark,
PassName, Fn, DLoc, Msg, Hotness) {}
@@ -528,9 +526,8 @@ public:
/// matches the regular expression given in -Rpass-missed=, then the
/// diagnostic will be emitted. \p RemarkName is a textual identifier for the
/// remark. \p Inst is the instruction that the optimization operates on.
- DiagnosticInfoOptimizationRemarkMissed(const char *PassName,
- StringRef RemarkName,
- Instruction *Inst);
+ OptimizationRemarkMissed(const char *PassName, StringRef RemarkName,
+ Instruction *Inst);
static bool classof(const DiagnosticInfo *DI) {
return DI->getKind() == DK_OptimizationRemarkMissed;
@@ -541,8 +538,7 @@ public:
};
/// Diagnostic information for optimization analysis remarks.
-class DiagnosticInfoOptimizationRemarkAnalysis
- : public DiagnosticInfoOptimizationBase {
+class OptimizationRemarkAnalysis : public DiagnosticInfoOptimizationBase {
public:
/// \p PassName is the name of the pass emitting this diagnostic. If
/// this name matches the regular expression given in -Rpass-analysis=, then
@@ -552,11 +548,9 @@ public:
/// include the source code location. \p Msg is the message to show. Note that
/// this class does not copy this message, so this reference must be valid for
/// the whole life time of the diagnostic.
- DiagnosticInfoOptimizationRemarkAnalysis(const char *PassName,
- const Function &Fn,
- const DebugLoc &DLoc,
- const Twine &Msg,
- Optional<uint64_t> Hotness = None)
+ OptimizationRemarkAnalysis(const char *PassName, const Function &Fn,
+ const DebugLoc &DLoc, const Twine &Msg,
+ Optional<uint64_t> Hotness = None)
: DiagnosticInfoOptimizationBase(DK_OptimizationRemarkAnalysis, DS_Remark,
PassName, Fn, DLoc, Msg, Hotness) {}
@@ -572,17 +566,16 @@ public:
bool shouldAlwaysPrint() const { return getPassName() == AlwaysPrint; }
protected:
- DiagnosticInfoOptimizationRemarkAnalysis(
- enum DiagnosticKind Kind, const char *PassName, const Function &Fn,
- const DebugLoc &DLoc, const Twine &Msg, Optional<uint64_t> Hotness)
+ OptimizationRemarkAnalysis(enum DiagnosticKind Kind, const char *PassName,
+ const Function &Fn, const DebugLoc &DLoc,
+ const Twine &Msg, Optional<uint64_t> Hotness)
: DiagnosticInfoOptimizationBase(Kind, DS_Remark, PassName, Fn, DLoc, Msg,
Hotness) {}
};
/// Diagnostic information for optimization analysis remarks related to
/// floating-point non-commutativity.
-class DiagnosticInfoOptimizationRemarkAnalysisFPCommute
- : public DiagnosticInfoOptimizationRemarkAnalysis {
+class OptimizationRemarkAnalysisFPCommute : public OptimizationRemarkAnalysis {
public:
/// \p PassName is the name of the pass emitting this diagnostic. If
/// this name matches the regular expression given in -Rpass-analysis=, then
@@ -594,12 +587,11 @@ public:
/// floating-point non-commutativity. Note that this class does not copy this
/// message, so this reference must be valid for the whole life time of the
/// diagnostic.
- DiagnosticInfoOptimizationRemarkAnalysisFPCommute(
- const char *PassName, const Function &Fn, const DebugLoc &DLoc,
- const Twine &Msg, Optional<uint64_t> Hotness = None)
- : DiagnosticInfoOptimizationRemarkAnalysis(
- DK_OptimizationRemarkAnalysisFPCommute, PassName, Fn, DLoc, Msg,
- Hotness) {}
+ OptimizationRemarkAnalysisFPCommute(const char *PassName, const Function &Fn,
+ const DebugLoc &DLoc, const Twine &Msg,
+ Optional<uint64_t> Hotness = None)
+ : OptimizationRemarkAnalysis(DK_OptimizationRemarkAnalysisFPCommute,
+ PassName, Fn, DLoc, Msg, Hotness) {}
static bool classof(const DiagnosticInfo *DI) {
return DI->getKind() == DK_OptimizationRemarkAnalysisFPCommute;
@@ -608,8 +600,7 @@ public:
/// Diagnostic information for optimization analysis remarks related to
/// pointer aliasing.
-class DiagnosticInfoOptimizationRemarkAnalysisAliasing
- : public DiagnosticInfoOptimizationRemarkAnalysis {
+class OptimizationRemarkAnalysisAliasing : public OptimizationRemarkAnalysis {
public:
/// \p PassName is the name of the pass emitting this diagnostic. If
/// this name matches the regular expression given in -Rpass-analysis=, then
@@ -621,12 +612,11 @@ public:
/// pointer aliasing legality. Note that this class does not copy this
/// message, so this reference must be valid for the whole life time of the
/// diagnostic.
- DiagnosticInfoOptimizationRemarkAnalysisAliasing(
- const char *PassName, const Function &Fn, const DebugLoc &DLoc,
- const Twine &Msg, Optional<uint64_t> Hotness = None)
- : DiagnosticInfoOptimizationRemarkAnalysis(
- DK_OptimizationRemarkAnalysisAliasing, PassName, Fn, DLoc, Msg,
- Hotness) {}
+ OptimizationRemarkAnalysisAliasing(const char *PassName, const Function &Fn,
+ const DebugLoc &DLoc, const Twine &Msg,
+ Optional<uint64_t> Hotness = None)
+ : OptimizationRemarkAnalysis(DK_OptimizationRemarkAnalysisAliasing,
+ PassName, Fn, DLoc, Msg, Hotness) {}
static bool classof(const DiagnosticInfo *DI) {
return DI->getKind() == DK_OptimizationRemarkAnalysisAliasing;
Modified: llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp Tue Sep 27 17:19:23 2016
@@ -141,8 +141,7 @@ void OptimizationRemarkEmitter::emitOpti
const Value *V,
const Twine &Msg) {
LLVMContext &Ctx = F->getContext();
- Ctx.diagnose(DiagnosticInfoOptimizationRemark(PassName, *F, DLoc, Msg,
- computeHotness(V)));
+ Ctx.diagnose(OptimizationRemark(PassName, *F, DLoc, Msg, computeHotness(V)));
}
void OptimizationRemarkEmitter::emitOptimizationRemark(const char *PassName,
@@ -156,8 +155,8 @@ void OptimizationRemarkEmitter::emitOpti
const Twine &Msg, bool IsVerbose) {
LLVMContext &Ctx = F->getContext();
if (!IsVerbose || shouldEmitVerbose())
- Ctx.diagnose(DiagnosticInfoOptimizationRemarkMissed(PassName, *F, DLoc, Msg,
- computeHotness(V)));
+ Ctx.diagnose(
+ OptimizationRemarkMissed(PassName, *F, DLoc, Msg, computeHotness(V)));
}
void OptimizationRemarkEmitter::emitOptimizationRemarkMissed(
@@ -171,8 +170,8 @@ void OptimizationRemarkEmitter::emitOpti
const Twine &Msg, bool IsVerbose) {
LLVMContext &Ctx = F->getContext();
if (!IsVerbose || shouldEmitVerbose())
- Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysis(
- PassName, *F, DLoc, Msg, computeHotness(V)));
+ Ctx.diagnose(
+ OptimizationRemarkAnalysis(PassName, *F, DLoc, Msg, computeHotness(V)));
}
void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysis(
@@ -185,16 +184,16 @@ void OptimizationRemarkEmitter::emitOpti
const char *PassName, const DebugLoc &DLoc, const Value *V,
const Twine &Msg) {
LLVMContext &Ctx = F->getContext();
- Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysisFPCommute(
- PassName, *F, DLoc, Msg, computeHotness(V)));
+ 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(DiagnosticInfoOptimizationRemarkAnalysisAliasing(
- PassName, *F, DLoc, Msg, computeHotness(V)));
+ Ctx.diagnose(OptimizationRemarkAnalysisAliasing(PassName, *F, DLoc, Msg,
+ computeHotness(V)));
}
void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysisAliasing(
Modified: llvm/trunk/lib/IR/DiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DiagnosticInfo.cpp?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/IR/DiagnosticInfo.cpp Tue Sep 27 17:19:23 2016
@@ -92,7 +92,7 @@ int llvm::getNextAvailablePluginDiagnost
return ++PluginKindID;
}
-const char *DiagnosticInfoOptimizationRemarkAnalysis::AlwaysPrint = "";
+const char *OptimizationRemarkAnalysis::AlwaysPrint = "";
DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm(const Instruction &I,
const Twine &MsgStr,
@@ -180,24 +180,25 @@ void DiagnosticInfoOptimizationBase::pri
DP << " (hotness: " << *Hotness << ")";
}
-bool DiagnosticInfoOptimizationRemark::isEnabled() const {
+bool OptimizationRemark::isEnabled() const {
return PassRemarksOptLoc.Pattern &&
PassRemarksOptLoc.Pattern->match(getPassName());
}
-DiagnosticInfoOptimizationRemarkMissed::DiagnosticInfoOptimizationRemarkMissed(
- const char *PassName, StringRef RemarkName, Instruction *Inst)
+OptimizationRemarkMissed::OptimizationRemarkMissed(const char *PassName,
+ StringRef RemarkName,
+ Instruction *Inst)
: DiagnosticInfoOptimizationBase(DK_OptimizationRemarkMissed, DS_Remark,
PassName, RemarkName,
*Inst->getParent()->getParent(),
Inst->getDebugLoc(), Inst->getParent()) {}
-bool DiagnosticInfoOptimizationRemarkMissed::isEnabled() const {
+bool OptimizationRemarkMissed::isEnabled() const {
return PassRemarksMissedOptLoc.Pattern &&
PassRemarksMissedOptLoc.Pattern->match(getPassName());
}
-bool DiagnosticInfoOptimizationRemarkAnalysis::isEnabled() const {
+bool OptimizationRemarkAnalysis::isEnabled() const {
return shouldAlwaysPrint() ||
(PassRemarksAnalysisOptLoc.Pattern &&
PassRemarksAnalysisOptLoc.Pattern->match(getPassName()));
@@ -210,14 +211,14 @@ void DiagnosticInfoMIRParser::print(Diag
void llvm::emitOptimizationRemark(LLVMContext &Ctx, const char *PassName,
const Function &Fn, const DebugLoc &DLoc,
const Twine &Msg) {
- Ctx.diagnose(DiagnosticInfoOptimizationRemark(PassName, Fn, DLoc, Msg));
+ Ctx.diagnose(OptimizationRemark(PassName, Fn, DLoc, Msg));
}
void llvm::emitOptimizationRemarkMissed(LLVMContext &Ctx, const char *PassName,
const Function &Fn,
const DebugLoc &DLoc,
const Twine &Msg) {
- Ctx.diagnose(DiagnosticInfoOptimizationRemarkMissed(PassName, Fn, DLoc, Msg));
+ Ctx.diagnose(OptimizationRemarkMissed(PassName, Fn, DLoc, Msg));
}
void llvm::emitOptimizationRemarkAnalysis(LLVMContext &Ctx,
@@ -225,8 +226,7 @@ void llvm::emitOptimizationRemarkAnalysi
const Function &Fn,
const DebugLoc &DLoc,
const Twine &Msg) {
- Ctx.diagnose(
- DiagnosticInfoOptimizationRemarkAnalysis(PassName, Fn, DLoc, Msg));
+ Ctx.diagnose(OptimizationRemarkAnalysis(PassName, Fn, DLoc, Msg));
}
void llvm::emitOptimizationRemarkAnalysisFPCommute(LLVMContext &Ctx,
@@ -234,8 +234,7 @@ void llvm::emitOptimizationRemarkAnalysi
const Function &Fn,
const DebugLoc &DLoc,
const Twine &Msg) {
- Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysisFPCommute(PassName, Fn,
- DLoc, Msg));
+ Ctx.diagnose(OptimizationRemarkAnalysisFPCommute(PassName, Fn, DLoc, Msg));
}
void llvm::emitOptimizationRemarkAnalysisAliasing(LLVMContext &Ctx,
@@ -243,8 +242,7 @@ void llvm::emitOptimizationRemarkAnalysi
const Function &Fn,
const DebugLoc &DLoc,
const Twine &Msg) {
- Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysisAliasing(PassName, Fn,
- DLoc, Msg));
+ Ctx.diagnose(OptimizationRemarkAnalysisAliasing(PassName, Fn, DLoc, Msg));
}
bool DiagnosticInfoOptimizationFailure::isEnabled() const {
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Tue Sep 27 17:19:23 2016
@@ -470,8 +470,7 @@ inlineCallsImpl(CallGraphSCC &SCC, CallG
if (Function *Callee = CS.getCalledFunction())
if (Callee->isDeclaration()) {
using namespace ore;
- ORE.emit(DiagnosticInfoOptimizationRemarkMissed(DEBUG_TYPE,
- "NoDefinition", &I)
+ ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, "NoDefinition", &I)
<< NV("Callee", Callee) << " will not be inlined into "
<< NV("Caller", CS.getCaller())
<< " because its definition is unavailable"
Modified: llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp Tue Sep 27 17:19:23 2016
@@ -710,7 +710,7 @@ bool DevirtModule::areRemarksEnabled() {
if (FL.empty())
return false;
const Function &Fn = FL.front();
- auto DI = DiagnosticInfoOptimizationRemark(DEBUG_TYPE, Fn, DebugLoc(), "");
+ auto DI = OptimizationRemark(DEBUG_TYPE, Fn, DebugLoc(), "");
return DI.isEnabled();
}
Modified: llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp Tue Sep 27 17:19:23 2016
@@ -769,9 +769,8 @@ public:
// With Rpass-analysis report why. This is on by default if distribution
// was requested explicitly.
ORE->emitOptimizationRemarkAnalysis(
- Forced ? DiagnosticInfoOptimizationRemarkAnalysis::AlwaysPrint
- : LDIST_NAME,
- L, Twine("loop not distributed: ") + Message);
+ Forced ? OptimizationRemarkAnalysis::AlwaysPrint : LDIST_NAME, L,
+ Twine("loop not distributed: ") + Message);
// Also issue a warning if distribution was requested explicitly but it
// failed.
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=282544&r1=282543&r2=282544&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Sep 27 17:19:23 2016
@@ -1298,7 +1298,7 @@ public:
return LV_NAME;
if (getForce() == LoopVectorizeHints::FK_Undefined && getWidth() == 0)
return LV_NAME;
- return DiagnosticInfoOptimizationRemarkAnalysis::AlwaysPrint;
+ return OptimizationRemarkAnalysis::AlwaysPrint;
}
bool allowReordering() const {
More information about the llvm-commits
mailing list