summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
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/lib/Analysis/LoopAccessAnalysis.cpp
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/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 0d774cf08e2..41c6068a9db 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -15,11 +15,11 @@
#include "llvm/Analysis/LoopAccessAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPassManager.h"
+#include "llvm/Analysis/OptimizationDiagnosticInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Analysis/VectorUtils.h"
-#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/PassManager.h"
@@ -94,14 +94,15 @@ bool VectorizerParams::isInterleaveForced() {
}
void LoopAccessReport::emitAnalysis(const LoopAccessReport &Message,
- const Function *TheFunction,
- const Loop *TheLoop,
- const char *PassName) {
+ const Loop *TheLoop, const char *PassName,
+ OptimizationRemarkEmitter &ORE) {
DebugLoc DL = TheLoop->getStartLoc();
- if (const Instruction *I = Message.getInstr())
+ const Value *V = TheLoop->getHeader();
+ if (const Instruction *I = Message.getInstr()) {
DL = I->getDebugLoc();
- emitOptimizationRemarkAnalysis(TheFunction->getContext(), PassName,
- *TheFunction, DL, Message.str());
+ V = I->getParent();
+ }
+ ORE.emitOptimizationRemarkAnalysis(PassName, DL, V, Message.str());
}
Value *llvm::stripIntegerCast(Value *V) {
OpenPOWER on IntegriCloud