summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-07-20 21:44:26 +0000
committerAdam Nemet <anemet@apple.com>2016-07-20 21:44:26 +0000
commit5b3a5cf6b07e3e624dfc96bf3800c300abe950ed (patch)
tree882bdb5bf64c6f62321bfc69625011e95a8d7f50 /llvm/include
parent6100d16e7d63b377038a1da54bc25c66779bdafc (diff)
downloadbcm5719-llvm-5b3a5cf6b07e3e624dfc96bf3800c300abe950ed.tar.gz
bcm5719-llvm-5b3a5cf6b07e3e624dfc96bf3800c300abe950ed.zip
[OptDiag,LV] Add hotness attribute to analysis remarks
The earlier change added hotness attribute to missed-optimization remarks. This follows up with the analysis remarks (the ones explaining the reason for the missed optimization). llvm-svn: 276192
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Analysis/LoopAccessAnalysis.h8
-rw-r--r--llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h16
-rw-r--r--llvm/include/llvm/IR/DiagnosticInfo.h5
3 files changed, 23 insertions, 6 deletions
diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
index ceee1be5e1e..367f2f4a3e2 100644
--- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
@@ -34,6 +34,7 @@ class Loop;
class SCEV;
class SCEVUnionPredicate;
class LoopAccessInfo;
+class OptimizationRemarkEmitter;
/// Optimization analysis message produced during vectorization. Messages inform
/// the user why vectorization did not occur.
@@ -63,10 +64,9 @@ public:
/// \brief Emit an analysis note for \p PassName with the debug location from
/// the instruction in \p Message if available. Otherwise use the location of
/// \p TheLoop.
- static void emitAnalysis(const LoopAccessReport &Message,
- const Function *TheFunction,
- const Loop *TheLoop,
- const char *PassName);
+ static void emitAnalysis(const LoopAccessReport &Message, const Loop *TheLoop,
+ const char *PassName,
+ OptimizationRemarkEmitter &ORE);
};
/// \brief Collection of parameters shared beetween the Loop Vectorizer and the
diff --git a/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h b/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h
index 71d989b45b3..d196774010a 100644
--- a/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h
+++ b/llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h
@@ -58,6 +58,22 @@ public:
void emitOptimizationRemarkMissed(const char *PassName, Loop *L,
const Twine &Msg);
+ /// 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.
+ void emitOptimizationRemarkAnalysis(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 emitOptimizationRemarkAnalysis(const char *PassName, Loop *L,
+ const Twine &Msg);
+
private:
Function *F;
diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h
index 1c78684da64..1a7232ad56c 100644
--- a/llvm/include/llvm/IR/DiagnosticInfo.h
+++ b/llvm/include/llvm/IR/DiagnosticInfo.h
@@ -487,9 +487,10 @@ public:
DiagnosticInfoOptimizationRemarkAnalysis(const char *PassName,
const Function &Fn,
const DebugLoc &DLoc,
- const Twine &Msg)
+ const Twine &Msg,
+ Optional<uint64_t> Hotness = None)
: DiagnosticInfoOptimizationBase(DK_OptimizationRemarkAnalysis, DS_Remark,
- PassName, Fn, DLoc, Msg) {}
+ PassName, Fn, DLoc, Msg, Hotness) {}
static bool classof(const DiagnosticInfo *DI) {
return DI->getKind() == DK_OptimizationRemarkAnalysis;
OpenPOWER on IntegriCloud